Created
August 7, 2023 07:07
-
-
Save raykipkorir/437f888d5c1aaf8b2c7984083518c861 to your computer and use it in GitHub Desktop.
Django and PostgreSQL services in docker compose - for local development
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.8" | |
services: | |
django: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
image: local_django | |
container_name: local_django | |
command: python manage.py runserver 0.0.0.0:8000 | |
ports: | |
- "8000:8000" | |
volumes: | |
- .:/app | |
env_file: | |
- .env | |
depends_on: | |
- postgres_local_db | |
postgres_local_db: | |
image: postgres | |
container_name: local_postgres | |
environment: | |
POSTGRES_USER: ${SQL_USER} | |
POSTGRES_PASSWORD: ${SQL_PASSWORD} | |
POSTGRES_DB: ${SQL_DATABASE} | |
volumes: | |
- postgres_local_data:/var/lib/postgresql/data | |
volumes: | |
postgres_local_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment