
version: '3.8'
services:
  web:
    build: ./docker
    env_file: ./config/.env.production
    ports: ["8080:8080"]
    depends_on: [db, redis, license_server]
    volumes: ["./web:/app/web"]
    restart: always
  license_server:
    build: ./docker
    command: python server/security/license_server.py
    env_file: ./config/.env.production
    ports: ["5001:5001"]
    restart: always
  db:
    image: postgres:15
    environment:
      POSTGRES_USER: mvuser
      POSTGRES_PASSWORD: mvpass
      POSTGRES_DB: moviemedia
    volumes: 
      - ./pgdata:/var/lib/postgresql/data
  redis:
    image: redis:alpine
    command: redis-server --requirepass ${REDIS_PASSWORD:-changeme}
  nginx:
    image: nginx:stable-alpine
    volumes:
      - ./deploy/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./web:/usr/share/nginx/html:ro
    ports: ["80:80","443:443"]
