~qeef/damn-deploy

ref: 14850af1a7132db1cd3317ad2733f00416c574bc damn-deploy/server.yml -rw-r--r-- 2.1 KiB
14850af1Jiri Vlasak Merge branch 'add-www' 5 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
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/
    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"
    upkeep:
        build: upkeep
        env_file: .env
        links:
            - db
    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"
    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"
volumes:
    damndb-volume: