Last active
December 26, 2020 15:23
-
-
Save zigomir/ac5e409e27a315ef38e82c957d3b409d to your computer and use it in GitHub Desktop.
Django local dev on docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
web: | |
build: . | |
command: python manage.py runserver 0.0.0.0:8000 | |
volumes: | |
- .:/app | |
ports: | |
- "8000:8000" | |
depends_on: | |
- db | |
db: | |
image: postgres | |
environment: | |
- POSTGRES_DB=db_name | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
ENV PYTHONUNBUFFERED 1 | |
RUN mkdir /app | |
WORKDIR /app | |
COPY requirements.txt /app/ | |
RUN pip install -r requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mostly taken from https://www.untangled.dev/2020/06/06/docker-django-local-dev/