2025-03-27 20:43:12 +00:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
nginx:
|
2025-03-28 18:34:25 +00:00
|
|
|
networks:
|
|
|
|
|
- frontend
|
2025-03-27 20:43:12 +00:00
|
|
|
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:
|
2025-03-30 06:50:02 +00:00
|
|
|
- mre_api
|
2025-03-27 20:43:12 +00:00
|
|
|
|
2025-03-28 18:34:25 +00:00
|
|
|
mre_api:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
2025-03-30 06:50:02 +00:00
|
|
|
dockerfile: docker/mre.Dockerfile
|
2025-03-28 18:34:25 +00:00
|
|
|
networks:
|
|
|
|
|
- frontend
|
|
|
|
|
- backend
|
2025-03-27 20:43:12 +00:00
|
|
|
volumes:
|
2025-03-28 18:34:25 +00:00
|
|
|
- ./app:/var/www/app # Mount your Flask app directory
|
2025-03-27 20:43:12 +00:00
|
|
|
- ./uwsgi.ini:/etc/uwsgi.ini # UWSGI configuration
|
|
|
|
|
command: uwsgi --ini /etc/uwsgi.ini
|
|
|
|
|
expose:
|
|
|
|
|
- 5000 # Expose the UWSGI port
|
|
|
|
|
environment:
|
2025-03-27 20:44:02 +00:00
|
|
|
- FLASK_APP=run.py # Adjust this based on your Flask app's entry point
|
|
|
|
|
- FLASK_ENV=dev # Dev environment
|
2025-03-28 21:32:01 +00:00
|
|
|
- MRE_POSTGRES_PASSWORD={{ POSTGRES_PASSWD }}
|
2025-03-28 18:34:25 +00:00
|
|
|
- MRE_POSTGRES_USER={{ POSTGRES_USER }}
|
2025-03-28 21:32:01 +00:00
|
|
|
- MRE_REDIS_PASSWORD={{ REDIS_PASSWD }}
|
2025-03-27 20:43:12 +00:00
|
|
|
depends_on:
|
2025-03-28 18:34:25 +00:00
|
|
|
- redis
|
|
|
|
|
- postgres
|
|
|
|
|
|
2025-03-27 20:43:12 +00:00
|
|
|
redis:
|
2025-03-28 18:34:25 +00:00
|
|
|
networks:
|
|
|
|
|
- backend
|
2025-03-27 20:43:12 +00:00
|
|
|
image: redis:latest
|
|
|
|
|
ports:
|
|
|
|
|
- "6379:6379" # Expose Redis port (for debugging/accessing from outside)
|
|
|
|
|
volumes:
|
|
|
|
|
- redis_data:/data # Persist Redis data
|
2025-03-28 21:32:01 +00:00
|
|
|
command: redis-server --save 20 1 --loglevel {{ LOG_LEGEL }} --requirepass {{ REDIS_PASSWD }}
|
2025-03-27 20:43:12 +00:00
|
|
|
|
|
|
|
|
postgres:
|
2025-03-28 18:34:25 +00:00
|
|
|
networks:
|
2025-03-30 06:50:02 +00:00
|
|
|
- backend
|
2025-03-27 20:43:12 +00:00
|
|
|
image: postgres:latest
|
|
|
|
|
ports:
|
|
|
|
|
- "5432:5432" # Expose PostgreSQL port (for debugging/admin)
|
|
|
|
|
environment:
|
2025-03-28 18:34:25 +00:00
|
|
|
- POSTGRES_USER={{ POSTGRES_USER }} # Replace with your desired username
|
2025-03-28 21:32:01 +00:00
|
|
|
- POSTGRES_PASSWORD={{ POSTGRES_PASSWD }} # Replace with your desired password
|
2025-03-27 20:43:12 +00:00
|
|
|
- POSTGRES_DB=yourdb # Replace with your desired database name
|
|
|
|
|
volumes:
|
|
|
|
|
- postgres_data:/var/lib/postgresql/data # Persist PostgreSQL data
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
postgres_data:
|
2025-03-28 18:34:25 +00:00
|
|
|
redis_data:
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
frontend:
|
|
|
|
|
driver: bridge
|
|
|
|
|
backend:
|
|
|
|
|
driver: bridge
|
|
|
|
|
internal: true
|