mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
* feat: adds docker local files to ignore * feat: adds replica key to django q settings * feat: adds multiple database routers testing utility * feat: ensures scheduler works with multiple databases and replicas * feat: adds docker image to support containerized development * refactor: removes unnecessary import * style: improves import styling * docs: adds replica setting to configure documentation
40 lines
918 B
Docker
40 lines
918 B
Docker
# Sets the python version
|
|
FROM python:3.9.5-slim
|
|
|
|
# Allows the logs generated by python apps to be rendered in the terminal
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
# Sets the default shell to bash
|
|
ENV SHELL /bin/bash
|
|
|
|
# Creates a non-root user
|
|
RUN adduser --disabled-password docker
|
|
|
|
# Upgrades pip
|
|
RUN pip install --upgrade pip
|
|
|
|
# Poetry project setup for development
|
|
# Copies poetry requirements files
|
|
COPY --chown=docker Dockerfile.dev requirements.txt* setup.py* ./
|
|
|
|
RUN pip install -r requirements.txt
|
|
|
|
RUN pip install pytest pytest-django codecov poetry
|
|
|
|
# Clean up
|
|
RUN apt-get autoremove -y \
|
|
&& apt-get clean -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /home/docker
|
|
|
|
# Sets the binaries to path
|
|
ENV PATH="/home/docker/.local/bin:${PATH}"
|
|
|
|
# Copy in as non-root user, so permissions match what we need
|
|
COPY --chown=docker:docker . .
|
|
|
|
RUN python setup.py develop
|
|
|
|
# Applies the container user to be non-root
|
|
USER docker |