version: '3.11'
services:
  web:
    build: .
    restart: always
    command: ${COMMAND:-sh ./scripts/entrypoint.sh}
    volumes:
      - .:/code
    ports:
    - ${PORT:-8001}:8000
    depends_on:
      - db
      - redis
    networks:
      - eggs
  db:
    image: postgres:13
    restart: always
    environment:
      POSTGRES_DB: django
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: '2309'
    volumes:
      - pg_data:/var/lib/postgresql/data
    networks:
      - eggs
  redis:
    restart: always
    image: redis
    networks:
      - eggs

  celery:
    build: .
    command: sh ./scripts/celery.sh
    restart: always
    volumes:
     - .:/code
    depends_on:
     - web
     - redis
    networks:
      - eggs

volumes:
  pg_data: null

networks:
  eggs:
    driver: bridge
