-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
41 lines (39 loc) · 1.64 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
version: "3"
services:
webserver:
image: ${APP_NAME}:${ENV}
container_name: ${APP_NAME}
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
working_dir: /var/www
# ports:
# - 9000:9000
tty: true
environment:
APP_NAME: "${APP_NAME}"
SERVER_HOST: "${SERVER_HOST}"
SERVER_PORT: "${SERVER_PORT}"
DB_HOST: "${DB_HOST}"
DB_USERNAME: "${DB_USERNAME}"
DB_PASSWORD: "${DB_PASSWORD}"
networks:
- proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.${APP_NAME}_${ENV}.entrypoints=http"
- "traefik.http.routers.${APP_NAME}_${ENV}.rule=Host(`${DOMAIN}`)"
- "traefik.http.middlewares.${APP_NAME}_${ENV}-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.${APP_NAME}_${ENV}.middlewares=${APP_NAME}_${ENV}-https-redirect"
- "traefik.http.routers.${APP_NAME}_${ENV}-secure.entrypoints=https"
- "traefik.http.routers.${APP_NAME}_${ENV}-secure.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${APP_NAME}_${ENV}-secure.tls=true"
- "traefik.http.routers.${APP_NAME}_${ENV}-secure.tls.certresolver=http"
- "traefik.http.routers.${APP_NAME}_${ENV}-secure.service=${APP_NAME}_${ENV}"
- "traefik.http.services.${APP_NAME}_${ENV}.loadbalancer.server.port=${SERVER_PORT}"
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto = https"
- "traefik.docker.network=proxy"
networks:
proxy:
external: true