MRE/docker/docker-compose.yaml.tmpl
2025-03-30 00:50:02 -06:00

73 lines
1.9 KiB
Cheetah

version: "3.8"
services:
nginx:
networks:
- frontend
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:
- mre_api
mre_api:
build:
context: .
dockerfile: docker/mre.Dockerfile
networks:
- frontend
- backend
volumes:
- ./app:/var/www/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
- MRE_POSTGRES_PASSWORD={{ POSTGRES_PASSWD }}
- MRE_POSTGRES_USER={{ POSTGRES_USER }}
- MRE_REDIS_PASSWORD={{ REDIS_PASSWD }}
depends_on:
- redis
- postgres
redis:
networks:
- backend
image: redis:latest
ports:
- "6379:6379" # Expose Redis port (for debugging/accessing from outside)
volumes:
- redis_data:/data # Persist Redis data
command: redis-server --save 20 1 --loglevel {{ LOG_LEGEL }} --requirepass {{ REDIS_PASSWD }}
postgres:
networks:
- backend
image: postgres:latest
ports:
- "5432:5432" # Expose PostgreSQL port (for debugging/admin)
environment:
- POSTGRES_USER={{ POSTGRES_USER }} # Replace with your desired username
- POSTGRES_PASSWORD={{ POSTGRES_PASSWD }} # 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:
networks:
frontend:
driver: bridge
backend:
driver: bridge
internal: true