-
Notifications
You must be signed in to change notification settings - Fork 14
/
docker-compose.yml
185 lines (172 loc) · 6.03 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
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
version: '3.9'
name: tripsit-dev-apps
########################### EXTENSION FIELDS
# Common environment values
x-environment: &default-tz-puid-pgid
TZ: $TZ
PUID: 1000
PGID: 1000
# Keys common to some of the core services that we always to automatically restart on failure
x-common-keys-core: &common-keys-core
security_opt:
- no-new-privileges:true
restart: always
# Keys common to some of the dependent services/apps
x-common-keys-apps: &common-keys-apps
security_opt:
- no-new-privileges:true
restart: unless-stopped
########################### SERVICES
services:
tripbot:
<<: *common-keys-apps
build:
context: ./
dockerfile: ./src/docker/Dockerfile.tripbot
# Only will build development stage from our dockerfile
target: development
container_name: tripbot
depends_on:
- tripbot_database
working_dir: /usr/src/app
env_file:
- .env
environment:
<<: *default-tz-puid-pgid
networks:
- tripbot-net
- tripbot_database-net
- tripbot_website-net
- moodle_data-net
volumes:
# - ./src/global/assets:/usr/src/app/assets/data # For viewing downloaded assets in development
- ./assets:/usr/src/app/build/assets # For viewing downloaded assets in development
- ./src:/usr/src/app/src # Needed for hot-reloading of source code
- ./.env:/usr/src/app/.env # Needed for hot-reloading the .env
labels:
- com.centurylinklabs.watchtower.enable=false
- traefik.enable=true
- traefik.docker.network=tripbot-net
- traefik.http.services.tripbot.loadbalancer.server.port=1337
- traefik.http.routers.tripbot.rule=Host(`api.${BOT_DOMAIN}`)
- traefik.http.routers.tripbot.rule=Host(`tripbot.${DNS_DOMAIN}`) && PathPrefix(`/api`) || Host(`api.${DNS_DOMAIN}`) || Host(`${DNS_DOMAIN}`) && PathPrefix(`/api`)
- traefik.http.routers.tripbot.service=tripbot
- traefik.http.routers.tripbot.entrypoints=websecure
- traefik.http.routers.tripbot.tls=true
- traefik.http.routers.tripbot.middlewares=tripbot@file,redirectApi@file
tripbot_database:
<<: *common-keys-apps
image: postgres:15.4
container_name: tripbot_database
# Uncomment this if you want the DB to persist between rebuilds
# volumes:
# - ${DOCKERDIR}/appdata/database/data:/var/lib/postgresql/data
networks:
- tripbot_database-net
environment:
<<: *default-tz-puid-pgid
POSTGRES_DB: tripsit
POSTGRES_USER: tripsit
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
labels:
- com.centurylinklabs.watchtower.enable=false
- traefik.docker.network=tripbot_database-net
- traefik.enable=false
tripbot_pgadmin:
image: dpage/pgadmin4:latest
restart: unless-stopped
container_name: tripbot_pgadmin
depends_on:
- tripbot_database
volumes:
- ./src/pgadmin4/servers.json:/pgadmin4/servers.json
networks:
- tripbot_pgadmin-net
- tripbot_database-net
environment:
<<: *default-tz-puid-pgid
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD}
labels:
- com.centurylinklabs.watchtower.enable=false
- traefik.enable=true
- traefik.docker.network=tripbot_pgadmin-net
- traefik.http.services.tripbot_pgadmin-svc.loadbalancer.server.port=80
- traefik.http.routers.tripbot_pgadmin.rule=Host(`database.${DNS_DOMAIN}`, `db.${DNS_DOMAIN}`, `pgadmin.${DNS_DOMAIN}`)
- traefik.http.routers.tripbot_pgadmin.entrypoints=websecure
- traefik.http.routers.tripbot_pgadmin.tls.certresolver=letsencrypt
- traefik.http.routers.tripbot_pgadmin.service=tripbot_pgadmin-svc
- traefik.http.routers.tripbot_pgadmin.middlewares=default@file
# tripbot_redis:
# <<: *common-keys-core
# image: bitnami/redis:latest
# container_name: tripbot_redis
# user: root
# # ports:
# # - 6379:6379
# networks:
# - tripbot_redis-net
# environment:
# # - REDIS_PASSWORD=Password123
# - ALLOW_EMPTY_PASSWORD=yes
# - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
# labels:
# - com.centurylinklabs.watchtower.enable=false
# - traefik.docker.network=tripbot_redis-net
# - traefik.enable=false
# tripbot_api:
# <<: *common-keys-apps
# build:
# context: ./
# dockerfile: ./src/docker/Dockerfile.api
# # Only will build development stage from our dockerfile
# target: development
# container_name: tripbot_api
# depends_on:
# - tripbot_database
# - tripbot_redis
# # ports:
# # - 5000:5000
# # - 9229:9229
# networks:
# - tripbot_api-net
# - tripbot_database-net
# - tripbot_redis-net
# volumes:
# - ./src:/usr/src/app/src # Needed for hot-reloading of source code
# environment:
# <<: *default-tz-puid-pgid
# PORT: 5000
# DATABASE_URL: postgres://tripsit:${POSTGRESQL_PASSWORD}@tripbot_database:5432/tripsit
# labels:
# - com.centurylinklabs.watchtower.enable=false
# - traefik.enable=true
# - traefik.docker.network=tripbot_api-net
# - traefik.http.services.tripbot_api-svc.loadbalancer.server.port=5000
# - traefik.http.routers.tripbot_api.rule=Host(`tripbot.${DNS_DOMAIN}`) && PathPrefix(`/api`) || Host(`api.${DNS_DOMAIN}`)
# - traefik.http.routers.tripbot_api.entrypoints=websecure
# - traefik.http.routers.tripbot_api.tls.certresolver=letsencrypt
# - traefik.http.routers.tripbot_api.service=tripbot_api-svc
# - traefik.http.routers.tripbot_api.middlewares=default@file
networks:
tripbot-net:
name: tripbot-net
tripbot_database-net:
name: tripbot_database-net
tripbot_redis-net:
name: tripbot_redis-net
tripbot_prisma-net:
name: tripbot_prisma-net
# external: true
tripbot_website-net:
name: tripbot_website-net
# external: true
tripbot_api-net:
name: tripbot_api-net
# external: true
tripbot_pgadmin-net:
name: tripbot_pgadmin-net
# external: true
moodle_data-net:
name: moodle_data-net
# external: true