forked from Nine-Minds/alga-psa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
157 lines (139 loc) · 4.31 KB
/
docker-compose.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
# Define environment variables at the top level
x-environment: &shared-environment
# ---- APP -------
VERSION: ${VERSION}
APP_NAME: ${APP_NAME}
APP_ENV: ${APP_ENV:-development}
NODE_ENV: ${APP_ENV:-development}
HOST: ${HOST}
VERIFY_EMAIL_ENABLED: ${VERIFY_EMAIL_ENABLED}
# ---- REDIS ----
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
REDIS_PASSWORD: ${REDIS_PASSWORD}
# ---- DATABASE ----
DB_TYPE: ${DB_TYPE}
DB_HOST: ${DB_HOST:-postgres}
DB_PORT: ${DB_PORT:-5432}
DB_USER: postgres
DB_NAME: postgres
DB_NAME_HOCUSPOCUS: ${DB_NAME_HOCUSPOCUS:-hocuspocus}
DB_USER_HOCUSPOCUS: ${DB_USER_HOCUSPOCUS:-hocuspocus_user}
DB_PASSWORD_HOCUSPOCUS: ${DB_PASSWORD_HOCUSPOCUS:-sebastian123}
DB_NAME_SERVER: ${DB_NAME_SERVER:-server}
DB_USER_SERVER: ${DB_USER_SERVER:-server_user}
DB_PASSWORD_SERVER: ${DB_PASSWORD_SERVER:-sebastian123}
POSTGRES_PASSWORD: ${DB_PASSWORD_SUPERUSER:-abcd1234!}
# ---- LOGGING ----
LOG_LEVEL: ${LOG_LEVEL}
LOG_IS_FORMAT_JSON: ${LOG_IS_FORMAT_JSON}
LOG_IS_FULL_DETAILS: ${LOG_IS_FULL_DETAILS}
LOG_ENABLED_FILE_LOGGING: ${LOG_ENABLED_FILE_LOGGING}
LOG_DIR_PATH: ${LOG_DIR_PATH}
LOG_ENABLED_EXTERNAL_LOGGING: ${LOG_ENABLED_EXTERNAL_LOGGING}
LOG_EXTERNAL_HTTP_HOST: ${LOG_EXTERNAL_HTTP_HOST}
LOG_EXTERNAL_HTTP_PORT: ${LOG_EXTERNAL_HTTP_PORT}
LOG_EXTERNAL_HTTP_PATH: ${LOG_EXTERNAL_HTTP_PATH}
LOG_EXTERNAL_HTTP_LEVEL: ${LOG_EXTERNAL_HTTP_LEVEL}
LOG_EXTERNAL_HTTP_TOKEN: ${LOG_EXTERNAL_HTTP_TOKEN}
# ---- HOCUSPOCUS ----
HOCUSPOCUS_PORT: ${HOCUSPOCUS_PORT}
HOCUSPOCUS_URL: ${HOCUSPOCUS_URL}
# ---- EMAIL ----
EMAIL_ENABLE: ${EMAIL_ENABLE}
EMAIL_FROM: ${EMAIL_FROM}
EMAIL_HOST: ${EMAIL_HOST}
EMAIL_PORT: ${EMAIL_PORT}
EMAIL_USERNAME: ${EMAIL_USERNAME}
EMAIL_PASSWORD: ${EMAIL_PASSWORD}
# ---- CRYPTO ----
CRYPTO_KEY: ${KEY}
CRYPTO_SALT_BYTES: ${SALT_BYTES}
CRYPTO_ITERATION: ${ITERATION}
CRYPTO_KEY_LENGTH: ${KEY_LENGTH}
CRYPTO_ALGORITHM: ${ALGORITHM}
# ---- TOKEN ----
TOKEN_SECRET_KEY: ${SECRET_KEY}
TOKEN_EXPIRES: ${TOKEN_EXPIRES}
# ---- AUTH ----
NEXTAUTH_URL: ${NEXTAUTH_URL}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
NEXTAUTH_SESSION_EXPIRES: ${NEXTAUTH_SESSION_EXPIRES}
# ---- GOOGLE AUTH ----
GOOGLE_OAUTH_CLIENT_ID: ${GOOGLE_OAUTH_CLIENT_ID}
GOOGLE_OAUTH_CLIENT_SECRET: ${GOOGLE_OAUTH_CLIENT_SECRET}
# ---- DEPLOY INFO ----
PROJECT_NAME: ${PROJECT_NAME}
EXPOSE_DB_PORT: ${EXPOSE_DB_PORT:-5432}
EXPOSE_HOCUSPOCUS_PORT: ${EXPOSE_HOCUSPOCUS_PORT:-1234}
EXPOSE_REDIS_PORT: ${EXPOSE_REDIS_PORT:-6379}
EXPOSE_SERVER_PORT: ${EXPOSE_SERVER_PORT:-3000}
services:
server:
extends:
file: ./server/docker-compose.yaml
service: server
container_name: ${PROJECT_NAME}_server
networks:
- app-network
environment:
<<: *shared-environment
depends_on:
hocuspocus:
condition: service_started
hocuspocus:
extends:
file: ./hocuspocus/docker-compose.yaml
service: hocuspocus
container_name: ${PROJECT_NAME}_hocuspocus
networks:
- app-network
environment:
<<: *shared-environment
depends_on:
redis:
condition: service_started
# setup:
# condition: service_completed_successfully
postgres:
image: ankane/pgvector:latest
container_name: ${PROJECT_NAME}_postgres
# volumes:
# - ./volumes/postgres:/var/lib/postgresql/data
networks:
- app-network
environment:
<<: *shared-environment
ports:
- "${EXPOSE_DB_PORT:-5432}:5432"
setup:
extends:
file: ./setup/docker-compose.yaml
service: setup
container_name: ${PROJECT_NAME}_setup
networks:
- app-network
environment:
<<: *shared-environment
depends_on:
postgres:
condition: service_started
# healthcheck:
# test: ["CMD-SHELL", "PGPASSWORD=${DB_PASSWORD_SUPERUSER} pg_isready -h $DB_HOST -p $DB_PORT -U $DB_USER"]
# interval: 10s
# retries: 5
# start_period: 30s
# timeout: 10s
redis:
image: 'redis:latest'
container_name: ${PROJECT_NAME}_redis
command: sh -c 'redis-server --save 20 1 --requirepass $$REDIS_PASSWORD --loglevel debug'
networks:
- app-network
environment:
<<: *shared-environment
ports:
- '${EXPOSE_REDIS_PORT:-6379}:6379'
networks:
app-network:
driver: bridge