-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-prod.yml
132 lines (120 loc) · 4.09 KB
/
docker-compose-prod.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
services:
client:
build:
context: ./client
dockerfile: Dockerfile
image: xccup-client
container_name: xccup-client
env_file: ./client/.env
restart: always
depends_on:
- server
labels:
traefik.enable: true
traefik.http.routers.xccup.rule: "Host(`xccup.net`)"
traefik.http.routers.xccup.entrypoints: websecure
traefik.http.routers.xccup.tls.certresolver: myresolver
traefik.http.routers.xccup.priority: 100
traefik.docker.network: traefik
server:
build:
context: ./server
dockerfile: Dockerfile
image: xccup-server
container_name: xccup-server
restart: always
env_file: ./server/.env
environment:
- NODE_ENV=production
volumes:
- ./data:/home/node/app/data
- ./import:/home/node/app/import
depends_on:
- db
- traefik
- igc-xc-score
labels:
traefik.enable: true
traefik.http.routers.xccup-api.rule: "Host(`xccup.net`) && PathPrefix(`/api`) || Host(`test.xccup.net`) && PathPrefix(`/api`)"
traefik.http.routers.xccup-api.entrypoints: websecure
traefik.http.routers.xccup-api.tls.certresolver: myresolver
traefik.http.services.xccup-api.loadbalancer.server.port: 65090
traefik.http.routers.xccup-api.priority: 200
traefik.docker.network: traefik
command: ./docker-entrypoint.sh
igc-xc-score:
container_name: igc-xc-score
build:
context: ./server/igc-xc-score
image: xc-igc-score
environment:
NODE_ENV: production
ports:
- 3030:3030
db:
image: postgis/postgis:13-3.1
container_name: xccup-db
restart: always
env_file: ./server/.env
ports:
- "127.0.0.1:5432:5432"
volumes:
- xccup-db:/var/lib/postgresql/data
pgadmin:
image: dpage/pgadmin4:latest
container_name: xccup-db-admin
restart: always
env_file: ./server/.env
volumes:
- pgadmin-data:/var/lib/pgadmin
labels:
traefik.enable: true
traefik.http.routers.xccup-pg-admin.rule: "Host(`pga.xccup.net`)"
traefik.http.routers.xccup-pg-admin.entrypoints: websecure
traefik.http.routers.xccup-pg-admin.tls.certresolver: myresolver
traefik.port: 65080
traefik.http.routers.xccup-pg-admin.priority: 100
traefik.docker.network: traefik
traefik:
image: traefik:2.10.1
restart: unless-stopped
container_name: traefik
command:
#- "--log.level=DEBUG"
#- "--api.insecure=true"
- "--log.level=ERROR"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.tlschallenge=true"
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=info@xccup.net"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
labels:
traefik.enable: true
# Global redirection: http to https
traefik.http.routers.http-catchall.rule: HostRegexp(`{host:(www\.)?.+}`)
traefik.http.routers.http-catchall.entrypoints: web
traefik.http.routers.http-catchall.middlewares: wwwtohttps
# Global redirection: https (www.) to https
traefik.http.routers.wwwsecure-catchall.rule: HostRegexp(`{host:(www\.).+}`)
traefik.http.routers.wwwsecure-catchall.entrypoints: websecure
traefik.http.routers.wwwsecure-catchall.tls: true
traefik.http.routers.wwwsecure-catchall.middlewares: wwwtohttps
# middleware: http(s)://(www.) to https://
traefik.http.middlewares.wwwtohttps.redirectregex.regex: ^https?://(?:www\.)?(.+)
traefik.http.middlewares.wwwtohttps.redirectregex.replacement: https://$${1}
traefik.http.middlewares.wwwtohttps.redirectregex.permanent: true
ports:
- "80:80"
- "443:443"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
volumes:
xccup-db:
pgadmin-data:
networks:
default:
name: traefik