-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-traefik.yml
91 lines (85 loc) · 2.86 KB
/
docker-compose-traefik.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
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
version: '3'
services:
traefik:
image: "traefik:testing"
container_name: "traefik"
restart: unless-stopped
command:
- "--accesslog=false"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--certificatesresolvers.selfhostedservices.acme.tlschallenge=true"
### Traefik Stafing ACME servers. Comment for PRODUCTION ###
- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
############################################################
- "--certificatesresolvers.selfhostedservices.acme.email=${LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.selfhostedservices.acme.storage=/letsencrypt/acme.json"
- "--api.insecure=true"
- "--api.dashboard=true"
- "--providers.docker"
- "--log.level=INFO"
ports:
- target: 80
published: 80
mode: host
- target: 443
published: 443
mode: host
- target: 8080
published: 8080
mode: host
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
0din:
container_name: 0din
image: artemisarrow/0din-docker:testing
volumes:
- /share:/the/directory/to/be/shared
environment:
- NODE_ID=${NODE_ID}
- NODE_PORT=${NODE_PORT}
- KNOWN_NODES=${KNOWN_NODES}
- DB_PASSWORD=${DB_PASSWORD}
- ENABLE_SSL=${ENABLE_SSL}
- ENABLE_HTTPS_REDIRECT=${ENABLE_HTTPS_REDIRECT}
- DB_USER=${DB_USER}
- DB_NAME=${DB_NAME}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
ports:
- 5000:5000
depends_on:
0din-postgres:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.0din.rule=Host(`${NODE_ID}`)"
- "traefik.http.services.0din.loadbalancer.server.port=${NODE_PORT}"
- "traefik.http.routers.0din.entrypoints=websecure"
- "traefik.http.routers.0din.tls.certresolver=selfhostedservices"
- "traefik.http.middlewares.accesscontrol.headers.customResponseHeaders.access-control-allow-origin=*"
- "traefik.http.routers.0din.middlewares=accesscontrol@docker"
0din-postgres:
container_name: 0din-postgres
image: postgres:14-alpine
restart: always
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_USER=${DB_USER}
- POSTGRES_DB=${DB_NAME}
ports:
- 5432:5432
volumes:
- 0din-postgres-db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
0din-postgres-db: