~qeef/damn-deploy

ref: 6f198c8c2003f9a3c124e6184bb552947c916116 damn-deploy/http.yml -rw-r--r-- 7.5 KiB
6f198c8cJiri Vlasak Upgrade manager 8 months ago
                                                                                
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
version: "3"
services:
    db:
        build: damndb
        container_name: damndb
        env_file: .env
        restart: always
        networks:
            default:
                aliases:
                    - damndb_server
        volumes:
            - damndb-volume:/var/lib/postgresql/data/
        command: ["postgres", "-c", "shared_buffers=409MB", "-c", "wal_buffers=32MB", "-c", "work_mem=32MB"]
    traefik:
        image: traefik:v2.0
        restart: always
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - ./traefik.yml:/etc/traefik/traefik.yml
            - ./acme.json:/acme.json
        ports:
            - 80:80
            - 443:443
        labels:
            - "traefik.http.routers.redir-unsec.rule=HostRegexp(`{subdomain:[a-z]+}.${DOMAIN_NAME}`) || Host(`${DOMAIN_NAME}`)"
            - "traefik.http.routers.redir-unsec.middlewares=redir-unsec@docker"
            - "traefik.http.middlewares.redir-unsec.redirectscheme.scheme=https"
            - "traefik.http.middlewares.redir-unsec.redirectscheme.permanent=true"
    api:
        build:
            context: server
            args:
                DAMN_SERVER_VERSION: ${DAMN_SERVER_VERSION}
        env_file: .env
        restart: always
        links:
            - db
        volumes:
            - ./server/tmp:/damn-server-tmp
        labels:
            - "traefik.http.routers.api.rule=Host(`${SERVER_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.api.tls=true"
            - "traefik.http.routers.api.tls.certresolver=le"
    chat:
        build:
            context: wschat_server
            args:
                DAMN_CHAT: ${CHAT_SUB}.${DOMAIN_NAME}
        env_file: .env
        restart: always
        labels:
            - "traefik.http.routers.chat.rule=Host(`${CHAT_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.chat.tls=true"
            - "traefik.http.routers.chat.tls.certresolver=le"
            - "traefik.websocket.routers.chat.rule=Host(`${CHAT_SUB}.${DOMAIN_NAME}`)"
            - "traefik.websocket.routers.chat.tls=true"
            - "traefik.websocket.routers.chat.tls.certresolver=le"
    osmsm_www:
        image: nginx
        restart: always
        environment:
            - NGINX_HOST=${OSMSM_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.osmsm.rule=Host(`${OSMSM_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.osmsm.tls=true"
            - "traefik.http.routers.osmsm.tls.certresolver=le"
        volumes:
            - osmsm-volume:/usr/share/nginx/html
    rss_www:
        image: nginx
        restart: always
        environment:
            - NGINX_HOST=${RSS_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.rss.rule=Host(`${RSS_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.rss.tls=true"
            - "traefik.http.routers.rss.tls.certresolver=le"
        volumes:
            - damn-rss-volume:/usr/share/nginx/html
    finished_www:
        build:
            context: finished
        env_file: .env
        restart: always
        environment:
            - NGINX_HOST=${FINISHED_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.finished.rule=Host(`${FINISHED_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.finished.tls=true"
            - "traefik.http.routers.finished.tls.certresolver=le"
        volumes:
            - finished-areas:/usr/share/nginx/html
    intersecting_www:
        image: nginx
        restart: always
        environment:
            - NGINX_HOST=${INTERSECTING_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.intersecting.rule=Host(`${INTERSECTING_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.intersecting.tls=true"
            - "traefik.http.routers.intersecting.tls.certresolver=le"
        volumes:
            - intersecting-areas:/usr/share/nginx/html
    www:
        build:
            context: ${WWW_REPO}
        restart: always
        labels:
            - "traefik.http.routers.www.rule=Host(`${WWW_SUB}.${DOMAIN_NAME}`) || Host(`${DOMAIN_NAME}`)"
            - "traefik.http.routers.www.tls=true"
            - "traefik.http.routers.www.tls.certresolver=le"
            - "traefik.http.routers.www.middlewares=redir-www@docker"
            - "traefik.http.middlewares.redir-www.redirectRegex.regex=^https://${DOMAIN_NAME}/(.*)"
            - "traefik.http.middlewares.redir-www.redirectRegex.replacement=https://${WWW_SUB}.${DOMAIN_NAME}/$${1}"
            - "traefik.http.middlewares.redir-www.redirectRegex.permanent=true"
    manager:
        build:
            context: manager
            args:
                DAMN_SERVER: ${SERVER_SUB}.${DOMAIN_NAME}
                DAMN_MANAGER_REPO: ${DAMN_MANAGER_REPO}
                DAMN_MANAGER_VERSION: ${DAMN_MANAGER_VERSION}
        env_file: .env
        restart: always
        environment:
            - NGINX_HOST=${MANAGER_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.manager.rule=Host(`${MANAGER_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.manager.tls=true"
            - "traefik.http.routers.manager.tls.certresolver=le"
    client:
        build:
            context: client
            args:
                DAMN_SERVER: ${SERVER_SUB}.${DOMAIN_NAME}
                DAMN_OSMSM: ${OSMSM_SUB}.${DOMAIN_NAME}
                DAMN_CLIENT_REPO: ${DAMN_CLIENT_REPO}
                DAMN_CLIENT_VERSION: ${DAMN_CLIENT_VERSION}
                DEFAULT_LANG: ${DEFAULT_LANG}
                DEFAULT_WEB_EDITOR: ${DEFAULT_WEB_EDITOR}
                DAMN_CHAT: ${CHAT_SUB}.${DOMAIN_NAME}
                GEN_CLIENT: "light"
        env_file: .env
        restart: always
        environment:
            - NGINX_HOST=${CLIENT_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.client.rule=Host(`${CLIENT_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.client.tls=true"
            - "traefik.http.routers.client.tls.certresolver=le"
    panel:
        build:
            context: client
            args:
                DAMN_SERVER: ${SERVER_SUB}.${DOMAIN_NAME}
                DAMN_CLIENT_REPO: ${DAMN_CLIENT_REPO}
                DAMN_CLIENT_VERSION: ${DAMN_CLIENT_VERSION}
                DEFAULT_LANG: ${DEFAULT_LANG}
                DEFAULT_WEB_EDITOR: ${DEFAULT_WEB_EDITOR}
                DAMN_CHAT: ${CHAT_SUB}.${DOMAIN_NAME}
                GEN_CLIENT: "panel"
        env_file: .env
        restart: always
        environment:
            - NGINX_HOST=${PANEL_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.panel.rule=Host(`${PANEL_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.panel.tls=true"
            - "traefik.http.routers.panel.tls.certresolver=le"
    mappy:
        build:
            context: client
            args:
                DAMN_SERVER: ${SERVER_SUB}.${DOMAIN_NAME}
                DAMN_OSMSM: ${OSMSM_SUB}.${DOMAIN_NAME}
                DAMN_CLIENT_REPO: ${DAMN_CLIENT_REPO}
                DAMN_CLIENT_VERSION: ${DAMN_CLIENT_VERSION}
                DEFAULT_LANG: ${DEFAULT_LANG}
                DEFAULT_WEB_EDITOR: ${DEFAULT_WEB_EDITOR}
                GEN_CLIENT: "mappy"
        env_file: .env
        restart: always
        environment:
            - NGINX_HOST=${MAPPY_SUB}.${DOMAIN_NAME}
        labels:
            - "traefik.http.routers.mappy.rule=Host(`${MAPPY_SUB}.${DOMAIN_NAME}`)"
            - "traefik.http.routers.mappy.tls=true"
            - "traefik.http.routers.mappy.tls.certresolver=le"
volumes:
    damndb-volume:
    osmsm-volume:
    damn-rss-volume:
    finished-areas:
    intersecting-areas: