Dockerfile split into prod and dev

This commit is contained in:
ayxan
2023-01-31 21:03:07 +04:00
parent 54d02bd56e
commit ee6b5e51c1
6 changed files with 39 additions and 7 deletions

6
Docker/Dev/Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM python:3
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
RUN pip install -r requirements.txt
COPY src /code/src/

View File

@@ -0,0 +1,18 @@
version: "3.9"
services:
django:
restart: always
environment:
- DJANGO_SETTINGS_MODULE=config.settings.development
build:
context: ../../
dockerfile: Docker/Dev/Dockerfile
command: >
bash -c "python3 src/manage.py makemigrations
&& python3 src/manage.py migrate
&& python src/manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
volumes:
- ../../src:/code/src