Last active
March 16, 2024 14:59
-
-
Save Mufaddal1125/8618521bb3ac2c914108b54b3e1481af to your computer and use it in GitHub Desktop.
Django server with postgres and redis
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: | |
| command: | |
| ["sh", "-c", "python manage.py migrate && python manage.py runserver"] | |
| volumes: | |
| - .:/app | |
| working_dir: /app | |
| ports: | |
| - "8000:8000" | |
| depends_on: | |
| - db | |
| environment: | |
| - DATABASE_URL=postgres://postgres:postgres@db:5432/postgres | |
| - REDIS_URL=redis://redis:6379/0 | |
| db: | |
| image: postgres:latest | |
| environment: | |
| POSTGRES_DB: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| redis: | |
| image: redis:latest | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| postgres_data: | |
| redis_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment