forked from runtipi/runtipi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yml
186 lines (179 loc) · 7.28 KB
/
docker-compose.dev.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
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
services:
runtipi-reverse-proxy:
container_name: runtipi-reverse-proxy
depends_on:
- runtipi
image: traefik:v3.0
restart: unless-stopped
ports:
- 80:80
- 443:443
- 8080:8080
command: --providers.docker
volumes:
- ./traefik:/etc/traefik
- ./traefik/shared:/shared
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- tipi_main_network
runtipi-db:
container_name: runtipi-db
image: postgres:14
restart: unless-stopped
stop_grace_period: 1m
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_USER: tipi
POSTGRES_DB: tipi
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d tipi -U tipi']
interval: 5s
timeout: 10s
retries: 120
networks:
- tipi_main_network
runtipi-redis:
container_name: runtipi-redis
image: redis:7.2.0
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD} --stop-writes-on-bgsave-error no
ports:
- 6379:6379
volumes:
- redisdata:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 10s
retries: 120
networks:
- tipi_main_network
runtipi:
build:
context: .
dockerfile: Dockerfile.dev
container_name: runtipi
restart: unless-stopped
depends_on:
runtipi-db:
condition: service_healthy
runtipi-redis:
condition: service_healthy
volumes:
# Hot reload
- ./src:/app/src
- ./packages/worker/src:/app/packages/worker/src
- ./packages/shared/src:/app/packages/shared/src
# Data
- ${RUNTIPI_MEDIA_PATH:-.}/media:/data/media
- ${RUNTIPI_STATE_PATH:-.}/state:/data/state
- ${RUNTIPI_REPOS_PATH:-.}/repos:/data/repos
- ${RUNTIPI_APPS_PATH:-.}/apps:/data/apps
- ${RUNTIPI_LOGS_PATH:-.}/logs:/data/logs
- ${RUNTIPI_TRAEFIK_PATH:-.}/traefik:/data/traefik
- ${RUNTIPI_USER_CONFIG_PATH:-.}/user-config:/data/user-config
- ${RUNTIPI_APP_DATA_PATH:-.}/app-data:/app-data
- ${RUNTIPI_BACKUPS_PATH:-.}/backups:/data/backups
# Static
- ./.env:/data/.env
- ./docker-compose.dev.yml:/data/docker-compose.yml
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc:/host/proc:ro
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- tipi_main_network
ports:
- 3000:3000
environment:
LOCAL: true
NODE_ENV: development
WORKER_APP_DIR: /app/packages/worker
DASHBOARD_APP_DIR: /app
env_file:
- .env
labels:
# ---- General ----- #
traefik.enable: true
traefik.http.middlewares.redirect-to-https.redirectscheme.scheme: https
# ---- Dashboard ---- #
traefik.http.services.dashboard.loadbalancer.server.port: 3000
# Local ip
traefik.http.routers.dashboard.rule: PathPrefix("/")
traefik.http.routers.dashboard.service: dashboard
traefik.http.routers.dashboard.entrypoints: web
# Websecure
traefik.http.routers.dashboard-insecure.rule: Host(`${DOMAIN}`) && PathPrefix(`/`)
traefik.http.routers.dashboard-insecure.service: dashboard
traefik.http.routers.dashboard-insecure.entrypoints: web
traefik.http.routers.dashboard-insecure.middlewares: redirect-to-https
traefik.http.routers.dashboard-secure.rule: Host(`${DOMAIN}`) && PathPrefix(`/`)
traefik.http.routers.dashboard-secure.service: dashboard
traefik.http.routers.dashboard-secure.entrypoints: websecure
traefik.http.routers.dashboard-secure.tls.certresolver: myresolver
# Local domain
traefik.http.routers.dashboard-local-insecure.rule: Host(`${LOCAL_DOMAIN}`)
traefik.http.routers.dashboard-local-insecure.entrypoints: web
traefik.http.routers.dashboard-local-insecure.service: dashboard
traefik.http.routers.dashboard-local-insecure.middlewares: redirect-to-https
# Secure
traefik.http.routers.dashboard-local.rule: Host(`${LOCAL_DOMAIN}`)
traefik.http.routers.dashboard-local.entrypoints: websecure
traefik.http.routers.dashboard-local.tls: true
traefik.http.routers.dashboard-local.service: dashboard
# ---- Worker ---- #
traefik.http.services.worker.loadbalancer.server.port: 5001
traefik.http.services.worker-api.loadbalancer.server.port: 5000
# Local ip
traefik.http.routers.worker.rule: PathPrefix("/worker")
traefik.http.routers.worker.service: worker
traefik.http.routers.worker.entrypoints: web
traefik.http.routers.worker-api.rule: PathPrefix("/worker-api")
traefik.http.routers.worker-api.service: worker-api
traefik.http.routers.worker-api.entrypoints: web
# Websecure
traefik.http.routers.worker-insecure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker`)
traefik.http.routers.worker-insecure.service: worker
traefik.http.routers.worker-insecure.entrypoints: web
traefik.http.routers.worker-insecure.middlewares: redirect-to-https
traefik.http.routers.worker-secure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker`)
traefik.http.routers.worker-secure.service: worker
traefik.http.routers.worker-secure.entrypoints: websecure
traefik.http.routers.worker-secure.tls.certresolver: myresolver
traefik.http.routers.worker-api-insecure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker-api`)
traefik.http.routers.worker-api-insecure.service: worker-api
traefik.http.routers.worker-api-insecure.entrypoints: web
traefik.http.routers.worker-api-insecure.middlewares: redirect-to-https
traefik.http.routers.worker-api-secure.rule: Host(`${DOMAIN}`) && PathPrefix(`/worker-api`)
traefik.http.routers.worker-api-secure.service: worker-api
traefik.http.routers.worker-api-secure.entrypoints: websecure
traefik.http.routers.worker-api-secure.tls.certresolver: myresolver
# Local domain
traefik.http.routers.worker-local-insecure.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker")
traefik.http.routers.worker-local-insecure.entrypoints: web
traefik.http.routers.worker-local-insecure.service: worker
traefik.http.routers.worker-local-insecure.middlewares: redirect-to-https
traefik.http.routers.worker-api-local-insecure.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker-api")
traefik.http.routers.worker-api-local-insecure.entrypoints: web
traefik.http.routers.worker-api-local-insecure.service: worker-api
traefik.http.routers.worker-api-local-insecure.middlewares: redirect-to-https
# Secure
traefik.http.routers.worker-local.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker")
traefik.http.routers.worker-local.entrypoints: websecure
traefik.http.routers.worker-local.tls: true
traefik.http.routers.worker-local.service: worker
traefik.http.routers.worker-api-local.rule: Host(`${LOCAL_DOMAIN}`) && PathPrefix("/worker-api")
traefik.http.routers.worker-api-local.entrypoints: websecure
traefik.http.routers.worker-api-local.service: worker-api
traefik.http.routers.worker-api-local.tls: true
networks:
tipi_main_network:
driver: bridge
name: runtipi_tipi_main_network
volumes:
pgdata:
redisdata: