Files
Deployments/nginx/docker-compose.yml
2020-05-19 22:44:58 +08:00

31 lines
1.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: "3.5"
#设定network. 其他应用应设置network的external为本网络以和nginx服务器互通。
networks:
firstnet:
name:nginx_firstnet
ipam:
config:
- subnet: 172.20.0.0/16
services:
nginx:
image: nginx:latest
restart: unless-stopped
volumes:
- ./data/conf/conf.d:/etc/nginx/conf.d
- ./data/conf/nginx.conf:/etc/nginx/nginx.conf
- ./data/html:/usr/share/nginx/html
- ./data/logs:/var/log/nginx
# 此处的配置取决于conf.d下的配置文件中如何配置证书路径。例如“ssl_certificate /etc/letsencrypt/live/git.woyue.org/fullchain.pem;”等
- ../certbot/conf:/etc/letsencrypt
# 此处的配置取决于conf.d下的配置文件中的配置“location /.well-known/acme-challenge/”可参看sample.conf
- ../certbot/www:/var/www/certbot
networks:
firstnet:
ipv4_address: 172.20.0.2
ports:
- "80:80"
- "443:443"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"