新增部分示例;更新部分镜像版本

This commit is contained in:
2024-04-22 10:53:00 +00:00
committed by cloud-init created default user
parent 78948bc57f
commit 0b36422e96
9 changed files with 167 additions and 2 deletions

13
examples/caddy/Caddyfile Normal file
View File

@@ -0,0 +1,13 @@
example.com {
root * /var/www/wordpress
encode gzip
php_fastcgi unix//run/php/php-version-fpm.sock
file_server
}
a.example.com {
reverse_proxy http://127.0.0.1:8080
log {
output file /var/log/caddy/a.example.com.log
}
}

View File

@@ -0,0 +1,44 @@
version: "3.9"
services:
caddy:
image: caddy:2.7.6-alpine
container_name: caddy
hostname: caddy
restart: always
networks:
- site_network
- app_network
ports:
- "443:443"
volumes:
- /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro
- ./hosts:/etc/hosts:ro
- ./Caddyfile:/etc/caddy/Caddyfile
- ./conf/:/config/
- ./site/:/var/www/
- ./data/:/data/
- ./logs/:/var/log/caddy
- ./cert/:/var/cert/
networks:
site_network:
name: site_network
external: true
# driver: bridge
# driver_opts:
# encrypted: 'true'
# ipam:
# driver: default
# config:
# - subnet: 172.21.0.1/24
app_network:
name: app_network
external: true
# driver: bridge
# driver_opts:
# encrypted: 'true'
# ipam:
# driver: default
# config:
# - subnet: 172.21.0.1/24

22
examples/caddy/hosts Normal file
View File

@@ -0,0 +1,22 @@
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts