Last active
December 16, 2019 03:28
-
-
Save Terkea/9eed1b7c7b5d9a8a646d012b29d5c4d5 to your computer and use it in GitHub Desktop.
dockerize django app with postgres and pgadmin
This file contains 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' | |
services: | |
db: | |
container_name: postgres_db | |
image: postgres | |
ports: | |
- "5432:5432" | |
web: | |
container_name: server | |
build: . | |
command: python src/manage.py runserver 0.0.0.0:8000 | |
volumes: | |
- .:/code | |
ports: | |
- 80:8000 | |
depends_on: | |
- db | |
pgadmin: | |
container_name: pgadmin4_ | |
image: dpage/pgadmin4 | |
restart: always | |
depends_on: | |
- db | |
ports: | |
- 5555:80 | |
environment: | |
PGADMIN_DEFAULT_EMAIL: pgadmin@example.com | |
PGADMIN_DEFAULT_PASSWORD: admin |
This file contains 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 /code | |
WORKDIR /code | |
COPY . /code/ | |
RUN pip install -r requirements.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment