services:
  client:
    image: uptime_client:latest
    environment:
      UPTIME_APP_API_BASE_URL: "https://uptime-demo.bluewavelabs.ca/api/v1"
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - server
    volumes:
      - ./nginx/conf.d:/etc/nginx/conf.d/:ro
      - ./certbot/www:/var/www/certbot/:ro
      - ./certbot/conf/:/etc/nginx/ssl/:ro

  certbot:
    image: certbot/certbot:latest
    volumes:
      - ./certbot/www/:/var/www/certbot/:rw
      - ./certbot/conf/:/etc/letsencrypt/:rw
  server:
    image: uptime_server:latest
    ports:
      - "5000:5000"
    env_file:
      - server.env
    depends_on:
      - redis
      - mongodb
  redis:
    image: uptime_redis:latest
    ports:
      - "6379:6379"
    volumes:
      - ./redis/data:/data
  mongodb:
    image: uptime_database_mongo:latest
    command: ["mongod", "--quiet", "--auth"]
    ports:
      - "27017:27017"
    volumes:
      - ./mongo/data:/data/db
      - ./mongo/init/create_users.js:/docker-entrypoint-initdb.d/create_users.js
    env_file:
      - mongo.env
