version: "3.7"
services:
  nginx:
    image: nginx:latest
    ports:
      - 80:80
    expose:
      - 80:80
    networks:
      - snap_net
    volumes:
      - .:/opt:ro
      - ./server/files/nginx/sites-enabled/site.conf:/etc/nginx/conf.d/default.conf:ro
#    command: sleep 60000

  app:
    image: laserapp:0.1
    environment:
      - DB_HOST=redis
    expose:
      - 5000
    ports:
      - "5000:5000"
    networks:
      - snap_net
    volumes:
      - ./app/:/app/
#    command: sleep 60000

  worker:
    image: laserapp:0.1
    environment:
      - DB_HOST=redis
    networks:
      - snap_net
    volumes:
      - ./app/:/app/
    command: bash -c "while true; do /usr/local/bin/python3 worker.py; sleep 1; done"

  redis:
    image: redis
    networks:
      - snap_net
    ports:
      - 6379

networks:
  snap_net:
    driver: bridge
