aboutsummaryrefslogtreecommitdiff
path: root/template/docker-compose.yaml.template
blob: f64543bfcabefd12271f61fb17d905bca77cd862 (plain)
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
196
197
services:
  timeline:
    image: crupest/timeline:latest
    pull_policy: always
    container_name: timeline
    restart: on-failure:3
    environment:
      - ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
      - TIMELINE_DisableAutoBackup=true
    volumes:
      - ./data/timeline:/root/timeline

  crupest-blog:
    pull_policy: build
    build:
      context: ./docker/crupest-blog
      dockerfile: Dockerfile
      pull: true
      tags:
        - "crupest/crupest-blog:latest"
    container_name: crupest-blog
    restart: on-failure:3
    volumes:
      - "blog-public:/public"

  nginx:
    pull_policy: build
    build:
      context: ./docker/crupest-nginx
      dockerfile: Dockerfile
      pull: true
      tags:
        - "crupest/crupest-nginx:latest"
    container_name: nginx
    restart: on-failure:3
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./nginx-config:/etc/nginx/conf.d:ro"
      - "./data/certbot/certs:/etc/letsencrypt:ro"
      - "./data/certbot/webroot:/srv/acme:ro"
      - "blog-public:/srv/blog:ro"

  crupest-api:
    pull_policy: build
    build:
      context: ./docker/crupest-api
      dockerfile: Dockerfile
      pull: true
      tags:
        - "crupest/crupest-api:latest"
    container_name: crupest-api
    volumes:
      - "./crupest-api-config.json:/crupest-api-config.json:ro"

  v2ray:
    pull_policy: build
    build:
      context: ./docker/crupest-v2ray
      dockerfile: Dockerfile
      pull: true
      tags:
        - "crupest/crupest-v2ray:latest"
    command: [ "run", "-c", "/etc/v2fly/config.json" ]
    container_name: v2ray
    restart: on-failure:3
    volumes:
      - "./v2ray-config.json:/etc/v2fly/config.json:ro"

  auto-certbot:
    pull_policy: build
    depends_on:
      - nginx
    build:
      context: ./docker/auto-certbot
      dockerfile: Dockerfile
      pull: true
      args:
        - CRUPEST_DOMAIN=$CRUPEST_DOMAIN
        - CRUPEST_EMAIL=$CRUPEST_EMAIL
        - CRUPEST_AUTO_CERTBOT_ADDITIONAL_PACKAGES=docker-cli
        - CRUPEST_AUTO_CERTBOT_POST_HOOK=docker restart nginx
      tags:
        - "crupest/auto-certbot:latest"
    container_name: auto-certbot
    volumes:
      - "./data/certbot/certs:/etc/letsencrypt"
      - "./data/certbot/data:/var/lib/letsencrypt"
      - "./data/certbot/webroot:/var/www/certbot"
      # map docker socket to allow auto-certbot to restart nginx
      - "/var/run/docker.sock:/var/run/docker.sock"
    restart: on-failure:3

  auto-backup:
    pull_policy: build
    build:
      context: ./docker/auto-backup
      dockerfile: Dockerfile
      pull: true
      args:
        - CRUPEST_AUTO_BACKUP_COS_SECRET_ID=${CRUPEST_AUTO_BACKUP_COS_SECRET_ID}
        - CRUPEST_AUTO_BACKUP_COS_SECRET_KEY=${CRUPEST_AUTO_BACKUP_COS_SECRET_KEY}
        - CRUPEST_AUTO_BACKUP_COS_REGION=${CRUPEST_AUTO_BACKUP_COS_REGION}
        - CRUPEST_AUTO_BACKUP_BUCKET_NAME=${CRUPEST_AUTO_BACKUP_BUCKET_NAME}
      tags:
        - "crupest/auto-backup:latest"
    container_name: auto-backup
    volumes:
      - "./data:/data"
    restart: on-failure:3

  mailserver:
    image: docker.io/mailserver/docker-mailserver:latest
    pull_policy: always
    container_name: mailserver
    # If the FQDN for your mail-server is only two labels (eg: example.com),
    # you can assign this entirely to `hostname` and remove `domainname`.
    hostname: mail
    domainname: $CRUPEST_DOMAIN
    env_file: mailserver.env
    # More information about the mail-server ports:
    # https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/
    # To avoid conflicts with yaml base-60 float, DO NOT remove the quotation marks.
    ports:
      - "25:25" # SMTP  (explicit TLS => STARTTLS)
      - "143:143" # IMAP4 (explicit TLS => STARTTLS)
      - "465:465" # ESMTP (implicit TLS)
      - "587:587" # ESMTP (explicit TLS => STARTTLS)
      - "993:993" # IMAP4 (implicit TLS)
    volumes:
      - ./data/dms/mail-data/:/var/mail/
      - ./data/dms/mail-state/:/var/mail-state/
      - ./data/dms/mail-logs/:/var/log/mail/
      - ./data/dms/config/:/tmp/docker-mailserver/
      - ./data/certbot/certs:/etc/letsencrypt
      - /etc/localtime:/etc/localtime:ro
    restart: on-failure:3
    stop_grace_period: 1m
    cap_add:
      - NET_ADMIN
    healthcheck:
      test: "ss --listening --tcp | grep -P 'LISTEN.+:smtp' || exit 1"
      timeout: 3s
      retries: 0

  debian-dev:
    pull_policy: build
    build:
      context: ./docker/crupest-debian-dev
      dockerfile: Dockerfile
      pull: true
      args:
        - USER=crupest
      tags:
        - "crupest/debian-dev:latest"
    container_name: debian-dev
    init: true
    command: [ "/bootstrap/start/code-server.bash" ]
    restart: on-failure:3
    volumes:
      - ./data/debian-dev:/data
      - debian-dev-home:/home/crupest

  forgejo:
    image: code.forgejo.org/forgejo/forgejo:9
    pull_policy: always
    container_name: forgejo
    restart: on-failure:3
    environment:
      - USER_UID=1000
      - USER_GID=1000
    volumes:
      - ./data/forgejo:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

  roundcubemail:
    image: roundcube/roundcubemail:latest
    container_name: roundcubemail
    restart: on-failure:3
    volumes:
      - ./data/roundcube/config:/var/roundcube/config
      - ./data/roundcube/db:/var/roundcube/db
      - rountcubemail-temp:/tmp/roundcube-temp
    environment:
      - ROUNDCUBEMAIL_DEFAULT_HOST=ssl://mail.crupest.life
      - ROUNDCUBEMAIL_DEFAULT_PORT=993
      - ROUNDCUBEMAIL_SMTP_SERVER=ssl://mail.crupest.life
      - ROUNDCUBEMAIL_SMTP_PORT=465
      - ROUNDCUBEMAIL_DB_TYPE=sqlite

volumes:
  blog-public:
  debian-dev-home:
  rountcubemail-temp: