1+ services :
2+
3+ # https://github.com/Tob1as/docker-php
4+ # based on: https://hub.docker.com/_/php (https://github.com/docker-library/php)
5+ # command: mkdir ./html && chown 33:33 ./html
6+ wsc-php :
7+ image : docker.io/tobi312/php:8.4-apache-wsc
8+ container_name : wsc-php
9+ restart : unless-stopped
10+ # ports:
11+ # - "80:80"
12+ volumes :
13+ - ./html:/var/www/html:rw
14+ environment :
15+ TZ : " ${TIMEZONE:-Europe/Berlin}"
16+ PHP_ERRORS : 0
17+ PHP_MEM_LIMIT : 256
18+ PHP_POST_MAX_SIZE : 250
19+ PHP_UPLOAD_MAX_FILESIZE : 250
20+ PHP_MAX_FILE_UPLOADS : 20
21+ PHP_MAX_EXECUTION_TIME : 120
22+ # # next env only with apache
23+ ENABLE_APACHE_REWRITE : 1
24+ ENABLE_APACHE_ALLOWOVERRIDE : 1
25+ ENABLE_APACHE_REMOTEIP : 1
26+ ENABLE_APACHE_STATUS : 1
27+ # APACHE_SERVER_NAME: "${DOMAIN}"
28+ # APACHE_SERVER_ADMIN: "webmaster@${DOMAIN}"
29+ # depends_on:
30+ # wsc-mariadb:
31+ # condition: service_started # service_started or service_healthy
32+ networks :
33+ - wsc-net
34+ - traefik
35+ labels :
36+ # Explicitly tell Traefik to expose this container
37+ - " traefik.enable=true"
38+ - " traefik.docker.network=traefik"
39+ # Tell Traefik to use the http port 80 to connect to container
40+ - " traefik.http.services.wsc.loadbalancer.server.port=80"
41+ - " traefik.http.services.wsc.loadbalancer.server.scheme=http" # when "https" then set "--serversTransport.insecureSkipVerify=true" for traefik
42+ # http
43+ - " traefik.http.routers.wsc-http.rule=Host(`${DOMAIN}`)"
44+ - " traefik.http.routers.wsc-http.entrypoints=web"
45+ - " traefik.http.routers.wsc-http.service=wsc"
46+ # https
47+ - " traefik.http.routers.wsc-https.tls=true"
48+ - " traefik.http.routers.wsc-https.rule=Host(`${DOMAIN}`)"
49+ - " traefik.http.routers.wsc-https.entrypoints=websecure"
50+ - " traefik.http.routers.wsc-https.service=wsc"
51+ # load middlewares for routes
52+ - " traefik.http.routers.wsc-http.middlewares=wsc-https"
53+ # - "traefik.http.routers.wsc-https.middlewares="
54+ # http to https redirect
55+ - " traefik.http.middlewares.wsc-https.redirectscheme.scheme=https"
56+ - " traefik.http.middlewares.wsc-https.redirectscheme.permanent=true"
57+ # - "traefik.http.middlewares.wsc-https.redirectscheme.port=443"
58+
59+ # https://hub.docker.com/_/mariadb
60+ # https://github.com/MariaDB/mariadb-docker
61+ # command: mkdir ./data-db && chown 999:999 ./data-db
62+ wsc-db :
63+ image : docker.io/library/mariadb:11.4
64+ container_name : wsc-db
65+ restart : unless-stopped
66+ volumes :
67+ - ./data-db:/var/lib/mysql:rw
68+ - ./config/mysql_wsc.cnf:/etc/mysql/conf.d/70-wsc.cnf:ro
69+ environment :
70+ TZ : " ${TIMEZONE:-Europe/Berlin}"
71+ MARIADB_ROOT_PASSWORD : " ${MYSQL_ROOT_PASSWORD}"
72+ MARIADB_DATABASE : " ${MYSQL_DATABASE:-wcf}"
73+ MARIADB_USER : " ${MYSQL_USER}"
74+ MARIADB_PASSWORD : " ${MYSQL_PASSWORD}"
75+ MARIADB_MYSQL_LOCALHOST_USER : " true"
76+ # MARIADB_AUTO_UPGRADE: 1
77+ # ports:
78+ # - 127.0.0.1:9306:3306/tcp
79+ healthcheck :
80+ test : mysqladmin ping -h 127.0.0.1 -u root --password=$$MARIADB_ROOT_PASSWORD || exit 1
81+ # test: mysqladmin ping -h 127.0.0.1 -u $$MARIADB_USER --password=$$MARIADB_PASSWORD || exit 1
82+ # start_period: 10s
83+ interval : 30s
84+ timeout : 5s
85+ retries : 3
86+ networks :
87+ wsc-net :
88+ aliases :
89+ - wsc-database
90+ - wsc-mysql
91+ - wsc-mariadb
92+
93+ networks :
94+ wsc-net :
95+ name : wsc-net
96+ traefik :
97+ name : traefik
98+ external : true
0 commit comments