-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
103 lines (98 loc) · 3.86 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
version: "2.4"
services:
php: # or: website
#build:
# context: ./
# dockerfile: debian.apache.Dockerfile
image: tobi312/php:8.1-apache
#image: tobi312/php:8.1-fpm-nginx-alpine
container_name: phpcontainer # or: website
#restart: unless-stopped
## ports ONLY with apache/nginx:
ports:
- "80:80"
- "443:443"
volumes:
#- apache-data:/var/www/html:rw
- ./html:/var/www/html:rw
## optional: folder with own entrypoint-file(s) mount:
#- ./entrypoint.d:/entrypoint.d:ro
## optional for apache: own ssl-cert and -key:
#- ./ssl/mySSL.crt:/etc/ssl/certs/ssl-cert-snakeoil.pem:ro
#- ./ssl/mySSL.key:/etc/ssl/private/ssl-cert-snakeoil.key:ro
## optional for nginx: own nginx.conf:
#- ./nginx_default.conf:/etc/nginx/http.d/default.conf:ro
environment:
TZ: "Europe/Berlin"
PHP_ERRORS: 1
PHP_MEM_LIMIT: 128
PHP_POST_MAX_SIZE: 250
PHP_UPLOAD_MAX_FILESIZE: 250
PHP_MAX_FILE_UPLOADS: 20
CREATE_PHPINFO_FILE: 0
CREATE_INDEX_FILE: 0
## next env only with php-fpm
#ENABLE_PHP_FPM_STATUS: 1
## next env only with apache
ENABLE_APACHE_REWRITE: 1
ENABLE_APACHE_ACTIONS: 0
ENABLE_APACHE_SSL: 0
ENABLE_APACHE_HEADERS: 0
ENABLE_APACHE_ALLOWOVERRIDE: 1
ENABLE_APACHE_REMOTEIP: 0
ENABLE_APACHE_STATUS: 1
ENABLE_APACHE_SSL_REDIRECT: 0
APACHE_SERVER_NAME: ""
APACHE_SERVER_ALIAS: ""
APACHE_SERVER_ADMIN: ""
DISABLE_APACHE_DEFAULTSITES: 0
## next env only with nginx
#ENABLE_NGINX_REMOTEIP: 0
#ENABLE_NGINX_STATUS: 1
healthcheck:
test: curl --fail http://127.0.0.1:80/server-status || exit 1
#test: curl --fail --insecure https://127.0.0.1:443/server-status || exit 1
#test: curl --fail http://127.0.0.1:80/nginx_status || exit 1
#test: curl --fail --insecure https://127.0.0.1:443/nginx_status || exit 1
# need installed "wget":
#test: wget --quiet --tries=1 --spider http://127.0.0.1:80/server-status || exit 1
#test: wget --quiet --tries=1 --spider --no-check-certificate https://127.0.0.1:443/server-status || exit 1
#test: wget --quiet --tries=1 --spider http://127.0.0.1:80/nginx_status || exit 1
#test: wget --quiet --tries=1 --spider --no-check-certificate https://127.0.0.1:443/nginx_status || exit 1
interval: 60s
timeout: 10s
retries: 3
networks:
website:
#labels:
# # for Traefik "docker-compose" example see: https://github.com/Tob1as/docker-kubernetes-collection/blob/master/examples_docker-compose/traefik.yml
# - "traefik.enable=true"
# #- "traefik.docker.network=website"
# - "traefik.http.services.website.loadbalancer.server.port=80"
# # http
# - "traefik.http.routers.website-http.rule=Host(`example.com`)"
# - "traefik.http.routers.website-http.entrypoints=web"
# - "traefik.http.routers.website-http.service=website"
# # https
# - "traefik.http.routers.website-https.tls=true"
# - "traefik.http.routers.website-https.rule=Host(`example.com`)"
# - "traefik.http.routers.website-https.entrypoints=websecure"
# - "traefik.http.routers.website-https.service=website"
# # http to https redirect
# - "traefik.http.routers.website-http.middlewares=website-https"
# - "traefik.http.middlewares.website-https.redirectscheme.scheme=https"
# #- "traefik.http.middlewares.website-https.redirectscheme.permanent=false"
# #- "traefik.http.middlewares.website-https.redirectscheme.port=443"
# https://github.com/robbertkl/docker-ipv6nat/issues/65#issuecomment-754600212
networks:
website:
name: website
# driver: bridge
# enable_ipv6: true
# ipam:
# driver: default
# config:
# - subnet: 172.20.0.0/24
# - subnet: fd00:dead:beef::/48
#volumes:
# apache-data: