~qeef/damn-deploy

ref: 5b5bf8cc7c819b1bb76f5a37d07e32ceac606616 damn-deploy/http.yml -rw-r--r-- 6.5 KiB
5b5bf8ccJiri Vlasak Fix not enough memory for 1 gb ram 1 year, 30 days 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
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
        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
    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: