volumes: postgres_data: services: ### redis redis: container_name: idrive-redis image: redis:latest restart: unless-stopped command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"] healthcheck: test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "PING"] interval: 5s timeout: 3s retries: 5 environment: - REDIS_PASSWORD=${REDIS_PASSWORD} deploy: resources: limits: memory: 256M ### database postgres: image: postgres:16 container_name: idrive-postgres restart: unless-stopped volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d idrive-postgres || exit 1" ] interval: 5s timeout: 3s retries: 5 environment: POSTGRES_DB: idrive-postgres POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ### Main backend backend: container_name: idrive-backend image: ghcr.io/pam-param-pam/idrive-backend:${BACKENDTAG:-latest} pull_policy: missing build: context: ./backend restart: unless-stopped ports: - ${BACKEND_PORT}:8000 depends_on: postgres: condition: service_healthy redis: condition: service_healthy healthcheck: test: ["CMD-SHELL", "python -c \"import urllib.request as u; u.urlopen('http://localhost:8000/healthcheck')\" || exit 1"] interval: 10s timeout: 10s retries: 5 environment: # General - IS_DEV_ENV=${IS_DEV_ENV} - DEPLOYMENT_HOST=${DEPLOYMENT_HOST} # Backend Configuration - BACKEND_SECRET_KEY=${BACKEND_SECRET_KEY} - BACKEND_BASE_URL=${PROTOCOL}://${DEPLOYMENT_HOST}/api # Redis Configuration - REDIS_PASSWORD=${REDIS_PASSWORD} - REDIS_ADDRESS=redis - REDIS_PORT=6379 # Postgres Configuration - POSTGRES_ADDRESS=postgres - POSTGRES_PORT=5432 - POSTGRES_NAME=idrive-postgres - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} deploy: resources: limits: memory: 1G ### nginx nginx: image: ghcr.io/pam-param-pam/idrive-nginx:${NGINXTAG:-latest} container_name: idrive-nginx build: context: ./frontend restart: unless-stopped ports: - ${NGINX_PORT}:80 depends_on: backend: condition: service_healthy healthcheck: test: [ "CMD-SHELL", "curl http://localhost:80/healthcheck || exit 1" ] interval: 10s timeout: 5s retries: 5 environment: - VITE_BACKEND_BASE_URL=${PROTOCOL}://${DEPLOYMENT_HOST}/api volumes: - ./nginx.conf:/etc/nginx/nginx.conf deploy: resources: limits: memory: 1G