I have hard time when developing django on my docker. When I make any changes to the code, I need to restart whole container for the changes to take effect.
I have a filesystem mounted locally and the changes are made locally. But even if I make changes directly in the container, make migrations or touch
an affected or wsgi file, the changes do not take any effect.
This is the image in compose file
backend:
container_name: 'backend'
image: dronetag/alpha-docker/backend
build: ./images/backend/
command: >
sh -c "
python manage.py collectstatic --no-input;
python manage.py migrate;
gunicorn backend.wsgi -b 0.0.0.0:80;"
ports:
- "10080:80"
- "10443:443"
volumes:
- ./src/backend:/src
depends_on:
- postgres
links:
- redis
- postgres
Dockerfile
FROM python:3.6
ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true
RUN mkdir /src
WORKDIR /src
COPY requirements.txt .
RUN pip install -r requirements.txt