services: backend-db: image: postgres:13-alpine environment: - POSTGRES_USER=${DB_USERNAME:-ataljudge} - POSTGRES_PASSWORD=${DB_PASSWORD:-ataljudge_password} - POSTGRES_DB=${DB_DATABASE:-ataljudge} volumes: - backend-db-data:/var/lib/postgresql/data restart: always mem_limit: 512m healthcheck: test: [ "CMD-SHELL", "pg_isready -U ${DB_USERNAME:-ataljudge}" ] interval: 30s timeout: 10s retries: 3 start_period: 40s backend-redis: image: redis:6-alpine command: - redis-server - --appendonly - "yes" - --requirepass - "${REDIS_PASSWORD:-}" volumes: - backend-redis-data:/data restart: always mem_limit: 256m healthcheck: test: [ "CMD", "redis-cli", "--no-auth-warning", "-a", "${REDIS_PASSWORD:-}", "ping" ] interval: 30s timeout: 10s retries: 3 start_period: 10s backend: build: context: . dockerfile: Dockerfile ports: - "3333:3333" environment: - PORT=3333 - NODE_ENV=production - DB_HOST=${DB_HOST:-backend-db} - DB_PORT=${DB_PORT:-5432} - DB_USERNAME=${DB_USERNAME:-ataljudge} - DB_PASSWORD=${DB_PASSWORD:-ataljudge_password} - DB_DATABASE=${DB_DATABASE:-ataljudge} - SECRET_KEY=${SECRET_KEY:-change_this_secret_key_in_production} - JWT_SECRET=${JWT_SECRET:-change_this_jwt_secret_in_production} - REDIS_HOST=${REDIS_HOST:-backend-redis} - REDIS_PORT=${REDIS_PORT:-6379} - REDIS_PASSWORD=${REDIS_PASSWORD:-} - ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-*} - MAIL_HOST=${MAIL_HOST:-smtp.gmail.com} - MAIL_PORT=${MAIL_PORT:-587} - MAIL_USERNAME=${MAIL_USERNAME:-} - MAIL_PASSWORD=${MAIL_PASSWORD:-} - MAIL_FROM=${MAIL_FROM:-noreply@ataljudge.com} - FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000} depends_on: backend-db: condition: service_healthy backend-redis: condition: service_healthy restart: always mem_limit: 512m healthcheck: test: [ "CMD-SHELL", "curl -f http://localhost:3333/health || exit 1" ] interval: 30s timeout: 10s retries: 3 start_period: 40s volumes: - /var/run/docker.sock:/var/run/docker.sock - /tmp/ataljudge-executions:/tmp/ataljudge-executions executor-python: container_name: ataljudge-executor-python build: context: ./backend/executor dockerfile: Dockerfile.python restart: always mem_limit: 512m expose: - "3000" executor-java: container_name: ataljudge-executor-java build: context: ./backend/executor dockerfile: Dockerfile.java restart: always mem_limit: 512m environment: - JAVA_STARTUP_OFFSET=${JAVA_STARTUP_OFFSET:-0.5} expose: - "3000" volumes: backend-db-data: backend-redis-data: