diff --git a/default.conf b/default.conf index c0536b2..f41af67 100644 --- a/default.conf +++ b/default.conf @@ -2,6 +2,10 @@ server { listen 80; server_name diyaa.de www.diyaa.de; + location /.well-known/acme-challenge/ { + root /var/www/certbot; + } + location / { proxy_pass http://web:3000; proxy_http_version 1.1; @@ -14,5 +18,4 @@ server { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } -} - +} \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 018a096..3cf5efb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,12 @@ services: NEXT_PUBLIC_CONTACT_EMAIL: ${NEXT_PUBLIC_CONTACT_EMAIL:-} NEXT_PUBLIC_LINKEDIN_URL: ${NEXT_PUBLIC_LINKEDIN_URL:-} NEXT_PUBLIC_GITHUB_URL: ${NEXT_PUBLIC_GITHUB_URL:-} + healthcheck: + test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1:3000/api/health || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 20s restart: unless-stopped nginx: @@ -31,6 +37,9 @@ services: - web ports: - "80:80" + - "443:443" volumes: - - ./default.conf:/etc/nginx/conf.d/default.conf:ro + - ./default.conf:/etc/nginx/conf.d/default.conf:ro + - ./certbot/www:/var/www/certbot:ro + - ./certbot/conf:/etc/letsencrypt:ro restart: unless-stopped \ No newline at end of file