-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
51 lines (47 loc) · 2.57 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
version: "3.7"
services:
# nginx-1.21.3 docker container with content
nginx:
image: "${NGINX_IMAGE_NAME}"
container_name: "${NGINX_CONTAINER_NAME}"
hostname: "${NGINX_HOSTNAME}"
labels:
# enable traefik
- "traefik.enable=true"
# middleware -> https redirect
- "traefik.http.middlewares.location_place_https.redirectscheme.scheme=https"
# middleware -> remove headers
- "traefik.http.middlewares.location_place_remove_headers.headers.customResponseHeaders.Server="
- "traefik.http.middlewares.location_place_remove_headers.headers.customResponseHeaders.X-Powered-By="
# middleware -> chain -> frame
- "traefik.http.middlewares.location_place_chain_without_auth.chain.middlewares=location_place_remove_headers"
# service -> load balancer
- "traefik.http.services.location_place_https_lb.loadbalancer.server.port=${PORT_HTTP}"
- "traefik.http.services.location_place_https_lb.loadbalancer.server.scheme=http"
# router -> http layer -> redirect https
- "traefik.http.routers.location_place_http.entrypoints=web"
- "traefik.http.routers.location_place_http.rule=Host(`${URL_PRODUCTION}`) || Host(`${URL_PRODUCTION_SHORT}`)"
- "traefik.http.routers.location_place_http.middlewares=location_place_https,location_place_chain_without_auth"
# router -> https layer -> GET, POST, etc.
- "traefik.http.routers.location_place_https.entrypoints=websecure"
- "traefik.http.routers.location_place_https.rule=Host(`${URL_PRODUCTION}`) || Host(`${URL_PRODUCTION_SHORT}`)"
- "traefik.http.routers.location_place_https.middlewares=location_place_chain_without_auth"
- "traefik.http.routers.location_place_https.service=location_place_https_lb"
- "traefik.http.routers.location_place_https.tls=true"
- "traefik.http.routers.location_place_https.tls.certresolver=letsencryptresolver"
# network
- "traefik.docker.network=${NETWORK_NAME_TRAEFIK_PUBLIC_PRODUCTION}"
restart: always
volumes:
- "./html/:/usr/share/nginx/html/"
- "./.docker/default.conf:/etc/nginx/conf.d/default.conf"
networks:
- traefik-public
- internal-com-twelvepics-c
networks:
traefik-public:
external: true
name: traefik-public
internal-com-twelvepics-c:
external: false
name: internal-com-twelvepics-c