version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: lawn-scheduler-app
    restart: unless-stopped
    volumes:
      - ./uploads:/app/uploads
      - ./lawn_scheduler.db:/app/lawn_scheduler.db
    environment:
      - NODE_ENV=production
    networks:
      - lawn-scheduler-network
    depends_on:
      - nginx

  nginx:
    image: webdevops/nginx:alpine
    container_name: lawn-scheduler-nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./nginx/conf.d:/etc/nginx/conf.d:ro
      - ./uploads:/var/www/uploads:ro
    networks:
      - lawn-scheduler-network
    depends_on:
      - app

networks:
  lawn-scheduler-network:
    driver: bridge

volumes:
  uploads:
  database: