add certbot but have to re-see because need to specify domain and email

This commit is contained in:
tuanvu
2026-02-13 16:04:25 +01:00
parent 180fd75947
commit 7fe633c476
2 changed files with 24 additions and 1 deletions

View File

@@ -1,5 +1,4 @@
services: services:
front: front:
build: build:
context: .. context: ..
@@ -8,6 +7,8 @@ services:
- "80:80" - "80:80"
volumes: volumes:
- ../doodlestudent/front:/app - ../doodlestudent/front:/app
- ./certbot/www:/var/www/certbot:ro
- ./certbot/conf:/etc/letsencrypt:ro
environment: environment:
- FLASK_ENV=development - FLASK_ENV=development
depends_on: depends_on:
@@ -18,6 +19,16 @@ services:
networks: networks:
- app-network - app-network
# https://stackoverflow.com/questions/57591868/how-correctly-install-ssl-certificate-using-certbot-in-docker
certbot:
image: certbot/certbot:latest
container_name: certbot
depends_on:
- front
volumes:
- ./certbot/www/:/var/www/certbot/:rw
- ./certbot/conf/:/etc/letsencrypt/:rw
back: back:
build: build:
context: .. context: ..

View File

@@ -2,10 +2,19 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name _; server_name _;
# server_name subdomain.your-domain.com;
# server_tokens off;
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
##########################
# Lets enkript
##########################
location /.well-known/acme-challenge/ {
root /var/www/certbot; # Root directory for Certbot challenges
}
########################## ##########################
# API # API
########################## ##########################
@@ -34,6 +43,9 @@ server {
########################## ##########################
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
# proxy_pass http://subdomain.your-domain.com:3000;
# Proxy requests to backend application running on port
# A revoir dans lets encrypt
} }
error_page 500 502 503 504 /50x.html; error_page 500 502 503 504 /50x.html;