docker-compose-kitchen

docker-compose-kitchen

View on GitHub

To test the certificates are working

$ nslookup server.domain.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   server.domain.com
Address: 23.12.43.56
version: "3.7"
services:
  nginx:
    image: nginx:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./certs:/etc/nginx/certs
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
server {
    listen 443 ssl;
    server_name  prod.domain.com;
    ssl_certificate /etc/nginx/certs/star_domain_com.chained.crt;
    ssl_certificate_key /etc/nginx/certs/star_domain.com.key;
    location / {
        allow all;
        root /usr/share/nginx/html;
    }

    root /usr/share/nginx/html;
    index index.html;
}
$ tree ../gcp/task-011-nginx-https-domain-test 
../gcp/task-011-nginx-https-domain-test
├── ReadMe.md
├── certs
│   ├── star_domain.com.key
│   └── star_domain_com.chained.crt
├── docker-compose.yml
└── nginx.conf

$ docker-compose up -d