services:
  web:
    build:
      context: ./dbapp
      dockerfile: Dockerfile
    env_file:
      - .env.prod
    depends_on:
      - db
    volumes:
      - static_volume:/app/staticfiles
    expose:
      - 8000

  worker:
    build:
      context: ./dbapp
      dockerfile: Dockerfile
    env_file:
      - .env.prod
    entrypoint: []
    command: ["uv", "run", "celery", "-A", "dbapp", "worker", "--loglevel=INFO"]
    depends_on:
      - db
      - redis
      - web

  redis:
    image: redis:7-alpine
    restart: unless-stopped
    ports:
      - 6379:6379

  db:
    image: postgis/postgis:18-3.6
    container_name: postgres-postgis
    restart: unless-stopped
    env_file:
      - .env.prod
    ports:
      - 5432:5432
    volumes:
      - pgdata:/var/lib/postgresql
    # networks:
    #   - app-network

  nginx:
    image: nginx:alpine
    depends_on:
      - web
    ports:
      - 8080:80
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - static_volume:/usr/share/nginx/html/static
      # если у тебя медиа — можно замонтировать том media

volumes:
  pgdata:
  static_volume: