version: '3.8'

services:
  nginx:
    build: ./nginx
    container_name: nginx
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./nginx/certs:/etc/nginx/certs
      - ./certbot/www:/var/www/certbot
      - ./certbot/conf:/etc/letsencrypt
    restart: unless-stopped

  certbot:
    image: certbot/certbot
    container_name: certbot
    volumes:
      - ./certbot/www:/var/www/certbot
      - ./certbot/conf:/etc/letsencrypt
    # entrypoint: >
    #   sh -c "certbot certonly --webroot --webroot-path=/var/www/certbot 
    #   --email omguerreiro@gmail.com --agree-tos --no-eff-email 
    #   -d innova.oguerreiro.com"