-
-
Notifications
You must be signed in to change notification settings - Fork 121
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
191 lines (183 loc) · 4.94 KB
/
docker-compose.yml
File metadata and controls
191 lines (183 loc) · 4.94 KB
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
version: "3.8"
services:
nixopus-api:
image: ghcr.io/${GITHUB_REPOSITORY:-raghavyuva/nixopus}-api:latest
container_name: nixopus-api
ports:
- "${API_PORT:-8443}:8443"
restart: unless-stopped
env_file:
- ${NIXOPUS_HOME:-/etc/nixopus}/source/api/.env
environment:
- AUTH_SERVICE_URL=${AUTH_SERVICE_URL:-http://nixopus-auth:9090}
volumes:
- ./logs:/app/logs
- ${NIXOPUS_HOME:-/etc/nixopus}:/etc/nixopus
- /var/run/docker.sock:/var/run/docker.sock
- ${NIXOPUS_HOME:-/etc/nixopus}/source/api/.env:/app/.env
networks:
- nixopus-network
depends_on:
nixopus-db:
condition: service_healthy
required: false
nixopus-auth:
condition: service_healthy
required: false
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8443/api/v1/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
nixopus-db:
image: postgres:14-alpine
container_name: nixopus-db
restart: unless-stopped
profiles:
- local-db
environment:
- POSTGRES_USER=${USERNAME}
- POSTGRES_PASSWORD=${PASSWORD}
- POSTGRES_DB=${DB_NAME}
- POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256
command:
- "postgres"
- "-c"
- "jit=0"
- "-c"
- "password_encryption=scram-sha-256"
- "-c"
- "max_connections=100"
- "-c"
- "shared_buffers=256MB"
- "-c"
- "log_connections=on"
- "-c"
- "log_disconnections=on"
ports:
- "127.0.0.1:${DB_PORT:-5432}:5432"
volumes:
- nixopus-db-data:/var/lib/postgresql/data
networks:
- nixopus-network
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${USERNAME} -d ${DB_NAME}"]
interval: 5s
timeout: 5s
retries: 5
nixopus-view:
image: ghcr.io/${GITHUB_REPOSITORY:-raghavyuva/nixopus}-view:latest
container_name: nixopus-view
build:
args:
- NEXT_PUBLIC_PORT=${NEXT_PUBLIC_PORT}
ports:
- "${NEXT_PUBLIC_PORT:-7443}:7443"
restart: unless-stopped
environment:
- HOSTNAME=0.0.0.0
- PORT=7443
- AUTH_SERVICE_URL=${AUTH_SERVICE_URL:-http://nixopus-auth:9090}
env_file:
- ${NIXOPUS_HOME:-/etc/nixopus}/source/view/.env
volumes:
- ./logs:/app/logs
- ${NIXOPUS_HOME:-/etc/nixopus}/source/view/.env:/app/.env
networks:
- nixopus-network
depends_on:
nixopus-auth:
condition: service_healthy
required: false
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:7443"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
nixopus-redis:
image: redis:7-alpine
container_name: nixopus-redis
restart: unless-stopped
ports:
- "127.0.0.1:${REDIS_PORT:-6379}:6379"
volumes:
- ${NIXOPUS_HOME:-/etc/nixopus}/redis:/data
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-changeme}
networks:
- nixopus-network
deploy:
resources:
limits:
cpus: '1'
memory: 512M
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-changeme}", "ping"]
interval: 5s
timeout: 5s
retries: 5
nixopus-caddy:
image: caddy:latest
container_name: nixopus-caddy
ports:
- "127.0.0.1:${CADDY_ADMIN_PORT:-2019}:2019"
- "${CADDY_HTTP_PORT:-80}:80"
- "${CADDY_HTTPS_PORT:-443}:443"
volumes:
- ${NIXOPUS_HOME:-/etc/nixopus}/source/helpers/Caddyfile:/etc/caddy/Caddyfile
- ${NIXOPUS_HOME:-/etc/nixopus}/caddy:/data
- ${NIXOPUS_HOME:-/etc/nixopus}/caddy:/config
command:
[
"caddy",
"run",
"--config",
"/etc/caddy/Caddyfile",
"--adapter",
"caddyfile",
]
networks:
- nixopus-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:2019/config/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
nixopus-auth:
image: ghcr.io/nixopus/auth:latest
container_name: nixopus-auth
ports:
- "${AUTH_SERVICE_PORT:-9090}:9090"
restart: unless-stopped
env_file:
- ${NIXOPUS_HOME:-/etc/nixopus}/auth/.env
volumes:
- ./logs:/app/logs
- ${NIXOPUS_HOME:-/etc/nixopus}/auth/.env:/app/.env
networks:
- nixopus-network
depends_on:
nixopus-db:
condition: service_healthy
required: false
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9090/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
nixopus-network:
driver: bridge
volumes:
nixopus-db-data: