-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
63 lines (58 loc) · 1.97 KB
/
docker-compose.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
version: '3.x'
volumes:
database:
pki:
uploads:
services:
traefik:
image: traefik:v3.0
restart: unless-stopped
command:
- '--certificatesresolvers.letsencrypt.acme.email=admin@$DOMAIN'
- '--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=http'
- '--certificatesresolvers.letsencrypt.acme.storage=/etc/pki/acme.json'
- '--certificatesresolvers.letsencrypt.acme.httpchallenge=true'
- '--entrypoints.http.http.redirections.entrypoint.to=https'
- '--entrypoints.http.http.redirections.entrypoint.scheme=https'
- '--log.level=DEBUG'
- '--entrypoints.http.address=:80'
- '--entrypoints.https.address=:443'
- '--providers.docker.exposedbydefault=false'
- '--providers.docker=true'
volumes:
- pki:/etc/pki
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- '80:80'
- '443:443'
app:
image: ${DOCKER_REPOSITORY}/app:${APP_VERSION:-latest}
build:
context: .
restart: unless-stopped
cap_add:
- SYS_ADMIN
labels:
traefik.enable: 'true'
traefik.http.routers.app.entrypoints: 'https'
traefik.http.routers.app.tls: 'true'
traefik.http.routers.app.tls.certresolver: 'letsencrypt'
traefik.http.routers.app.rule: 'Host(`$DOMAIN`) || Host(`www.$DOMAIN`)'
traefik.http.routers.app.tls.domains[0].main: $DOMAIN
traefik.http.routers.app.tls.domains[0].sans: www.$DOMAIN
traefik.http.routers.app.middlewares: 'compress'
traefik.http.middlewares.compress.compress: 'true'
environment:
DATABASE_CLIENT: postgres
DATABASE_NAME: ${DATABASE_NAME:-app}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-password}
DOMAIN: ${DOMAIN}
database:
image: postgres:15.2
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: ${DATABASE_NAME:-app}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-password}
volumes:
- database:/var/lib/postgresql