version: '3.11'

networks:
  dokploy-network:
    external: true
volumes:
  pg_data: null

services:
  eggs-web:
    networks:
      - dokploy-network
    build: .
    restart: always
    command: ${COMMAND:-sh ./scripts/entrypoint.sh}
    volumes:
      - .:/code
      - '../files/media:/code/media'
    depends_on:
      - eggs-db
      - eggs-redis
  eggs-db:
    networks:
      - dokploy-network
    image: postgres:13
    restart: always
    environment:
      POSTGRES_DB: django
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: '2309'
    volumes:
      - pg_data:/var/lib/postgresql/data
  eggs-redis:
    networks:
      - dokploy-network
    restart: always
    image: redis

  eggs-celery:
    build: .
    command: celery -A config worker --loglevel=info
    restart: always
    volumes:
     - .:/code
    depends_on:
     - eggs-web
     - eggs-redis
    environment:
      - CELERY_BROKER_URL=redis://eggs-redis:6379/
      - CELERY_RESULT_BACKEND=redis://eggs-redis:6379/
    networks:
      - dokploy-network