49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
nginx:
|
|
image: nginx:latest
|
|
ports:
|
|
- "80:80"
|
|
- "443:443" # Uncomment if you want SSL/TLS
|
|
volumes:
|
|
- ./nginx/conf.d:/etc/nginx/conf.d # Mount Nginx configuration
|
|
- ./static:/var/www/static # Serve static files
|
|
depends_on:
|
|
- uwsgi
|
|
|
|
uwsgi:
|
|
image: python:3.9-slim-buster # Use a slim Python image
|
|
volumes:
|
|
- ./app:/app # Mount your Flask app directory
|
|
- ./uwsgi.ini:/etc/uwsgi.ini # UWSGI configuration
|
|
command: uwsgi --ini /etc/uwsgi.ini
|
|
expose:
|
|
- 5000 # Expose the UWSGI port
|
|
environment:
|
|
- FLASK_APP=run.py # Adjust this based on your Flask app's entry point
|
|
- FLASK_ENV=dev # Dev environment
|
|
depends_on:
|
|
- redis # Ensure Redis is running before UWSGI starts
|
|
|
|
redis:
|
|
image: redis:latest
|
|
ports:
|
|
- "6379:6379" # Expose Redis port (for debugging/accessing from outside)
|
|
volumes:
|
|
- redis_data:/data # Persist Redis data
|
|
|
|
postgres:
|
|
image: postgres:latest
|
|
ports:
|
|
- "5432:5432" # Expose PostgreSQL port (for debugging/admin)
|
|
environment:
|
|
- POSTGRES_USER=youruser # Replace with your desired username
|
|
- POSTGRES_PASSWORD=yourpassword # Replace with your desired password
|
|
- POSTGRES_DB=yourdb # Replace with your desired database name
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data # Persist PostgreSQL data
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data: |