Files
django-q2/Dockerfile.dev
Alexandre Xavier 71d4b726ea Feature/improves multiple databases support (#561)
* 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
2021-05-23 15:10:31 +02:00

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