-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-individual.yaml
192 lines (181 loc) · 4.56 KB
/
docker-compose-individual.yaml
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
# Docker Compose file adapted from Chatting Platform
#
# Install Docker on your system to run and test
# the app in a production-like environment.
#
# Note: This file is intended for testing and does not
# implement best practices for a production deployment.
# If I were you, I would just normally install these services on a Linux machine.
# Such as: Fail2Ban, CrowdSec, Postgres, Nginx, SuperTokens, and Redis.
# View .env.example before deploying.
#
# Learn more: https://docs.docker.com/compose/reference/
#
# Build images: docker-compose build
# Start app: docker-compose up -d
#
version: '3'
services:
db:
image: 'postgres:alpine'
environment:
POSTGRES_USER: supertokens_user
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: supertokens
ports:
- 5432:5432
networks:
- app_network
volumes:
- ./scripts/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
restart: unless-stopped
healthcheck:
test: ['CMD', 'pg_isready -U supertokens_user']
interval: 5s
timeout: 5s
retries: 5
db2:
image: 'postgres:alpine'
environment:
POSTGRES_USER: prisma_user
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: prisma
ports:
- 5433:5432
networks:
- app_network
volumes:
- ./scripts/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
restart: unless-stopped
healthcheck:
test: ['CMD', 'pg_isready -U supertokens_user']
interval: 5s
timeout: 5s
retries: 5
pgAdmin:
image: dpage/pgadmin4
restart: unless-stopped
depends_on:
- db
networks:
- app_network
ports:
- 3442:80
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: ${DB_PASSWORD}
PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION: 'True'
PGADMIN_CONFIG_CONSOLE_LOG_LEVEL: 10
supertokens:
image: registry.supertokens.io/supertokens/supertokens-postgresql
depends_on:
- db
ports:
- 3567:3567
environment:
POSTGRESQL_USER: supertokens_user
POSTGRESQL_HOST: 'host.docker.internal'
POSTGRESQL_PORT: 5432
API_KEYS: ${SUPERTOKENS_API_KEY}
POSTGRESQL_PASSWORD: ${DB_PASSWORD}
POSTGRESQL_DATABASE_NAME: supertokens
networks:
- app_network
restart: unless-stopped
healthcheck:
test: >
bash -c 'exec 3<>/dev/tcp/127.0.0.1/3567 && echo -e "GET /hello HTTP/1.1\r\nhost: 127.0.0.1:3567\r\nConnection: close\r\n\r\n" >&3 && cat <&3 | grep "Hello"'
interval: 10s
timeout: 5s
retries: 5
authfrontend:
build: ./frontend
# depends_on:
# - cache
# - chatbackend
# - supertokens
ports:
- 3000:3000
environment:
NODE_ENV: production
networks:
- app_network
restart: unless-stopped
healthcheck:
test: >
bash -c 'npm run healthcheck'
interval: 10s
timeout: 5s
retries: 5
authbackend:
build: ./backend
depends_on:
- cache
# - supertokens
# - db
ports:
- 8000:8000
networks:
- app_network
environment:
- NODE_ENV=production
- REDIS_URL=redis://:${REDIS_PASSWORD}@host.docker.internal:6379
restart: unless-stopped
healthcheck:
test: >
bash -c 'npm run healthcheck'
interval: 10s
timeout: 5s
retries: 5
# nginx:
# build: ./Nginx
# ports:
# - 80:80
# - 4443:4443
# networks:
# - app_network
# restart: unless-stopped
# volumes:
# - /Nginx/config:/etc/nginx/
# - /Nginx/logs:/var/log/nginx
# - /Nginx/nginx.service:/etc/systemd/system/nginx.service
# # healthcheck:
# # test: >
# # bash -c 'service nginx status || exit 1'
# # interval: 10s
# # timeout: 5s
# # retries: 5
# fail2ban:
# image: lscr.io/linuxserver/fail2ban:latest
# restart: always
# depends_on:
# - nginx
# cap_add:
# - NET_ADMIN
# - NET_RAW
# ports:
# - '6379:6379'
# volumes:
# - /Fail2Ban/config:/config
# - /Nginx/logs:/remotelogs/nginx:ro #optional
# networks:
# - app_network
cache:
image: chainguard/valkey:latest
restart: always
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
networks:
- app_network
healthcheck:
test: ['CMD', 'redis-cli ping | grep PONG']
interval: 1s
timeout: 3s
retries: 5
networks:
app_network:
driver: bridge
volumes:
cache:
driver: local