Skip to main content

สร้าง Certbot container

server {
    listen 80;
    server_name test.nstru.ac.th;

    location /.well-known/acme-challenge/ {
        root /var/www/certbot;
    }
    
}

 เพิ่ม

version: '3'
services:
    nginx:
        image: nginx:1.17
        container_name: ngx
        restart: always
        ports:
            - 80:80
            - 443:443

    certbot:
        image: certbot/certbot
        container_name: certbot
        volumes: 
            - ./data/certbot/conf:/etc/letsencrypt
            - ./data/certbot/www:/var/www/certbot
        command: certonly --webroot -w /var/www/certbot --force-renewal --email suppachok_sin@nstru.ac.th -d arit-manaul.nstru.ac.th --agree-tos
        depends_on:      
            - nginx