Get the MRE api working #1

Merged
chris merged 50 commits from add_mre_api into main 2025-04-06 23:58:50 +00:00
Showing only changes of commit 24901135cb - Show all commits

View File

@ -2,6 +2,8 @@ version: "3.8"
services: services:
nginx: nginx:
networks:
- frontend
image: nginx:latest image: nginx:latest
ports: ports:
- "80:80" - "80:80"
@ -12,10 +14,15 @@ services:
depends_on: depends_on:
- uwsgi - uwsgi
uwsgi: mre_api:
image: python:3.9-slim-buster # Use a slim Python image build:
context: .
docker-file: docker/mre.docker-file
networks:
- frontend
- backend
volumes: volumes:
- ./app:/app # Mount your Flask app directory - ./app:/var/www/app # Mount your Flask app directory
- ./uwsgi.ini:/etc/uwsgi.ini # UWSGI configuration - ./uwsgi.ini:/etc/uwsgi.ini # UWSGI configuration
command: uwsgi --ini /etc/uwsgi.ini command: uwsgi --ini /etc/uwsgi.ini
expose: expose:
@ -23,23 +30,32 @@ services:
environment: environment:
- FLASK_APP=run.py # Adjust this based on your Flask app's entry point - FLASK_APP=run.py # Adjust this based on your Flask app's entry point
- FLASK_ENV=dev # Dev environment - FLASK_ENV=dev # Dev environment
- MRE_POSTGRES_PASSWORD={{ POSTGRES_PASSWORD }}
- MRE_POSTGRES_USER={{ POSTGRES_USER }}
- MRE_REDIS_PASSWORD={{ REDIS_PASSWORD }}
depends_on: depends_on:
- redis # Ensure Redis is running before UWSGI starts - redis
- postgres
redis: redis:
networks:
- backend
image: redis:latest image: redis:latest
ports: ports:
- "6379:6379" # Expose Redis port (for debugging/accessing from outside) - "6379:6379" # Expose Redis port (for debugging/accessing from outside)
volumes: volumes:
- redis_data:/data # Persist Redis data - redis_data:/data # Persist Redis data
command: redis-server --save 20 1 --loglevel {{ LOG_LEGEL }} --requirepass {{ REDIS_PASSWORD }}
postgres: postgres:
networks:
-backend
image: postgres:latest image: postgres:latest
ports: ports:
- "5432:5432" # Expose PostgreSQL port (for debugging/admin) - "5432:5432" # Expose PostgreSQL port (for debugging/admin)
environment: environment:
- POSTGRES_USER=youruser # Replace with your desired username - POSTGRES_USER={{ POSTGRES_USER }} # Replace with your desired username
- POSTGRES_PASSWORD=yourpassword # Replace with your desired password - POSTGRES_PASSWORD={{ POSTGRES_PASSWORD }} # Replace with your desired password
- POSTGRES_DB=yourdb # Replace with your desired database name - POSTGRES_DB=yourdb # Replace with your desired database name
volumes: volumes:
- postgres_data:/var/lib/postgresql/data # Persist PostgreSQL data - postgres_data:/var/lib/postgresql/data # Persist PostgreSQL data
@ -47,3 +63,10 @@ services:
volumes: volumes:
postgres_data: postgres_data:
redis_data: redis_data:
networks:
frontend:
driver: bridge
backend:
driver: bridge
internal: true