-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
125 lines (118 loc) · 2.78 KB
/
Copy pathdocker-compose.yml
File metadata and controls
125 lines (118 loc) · 2.78 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
services:
nginx:
image: nginx:alpine
container_name: nginx_gateway
ports:
- "80:80"
volumes:
- ./AuthGuard/nginx/:/etc/nginx/:ro
networks:
- authguard-network
command:
- sh
- -c
- |
echo "Waiting for authguard to start..."
while true; do
if nc -z authguard 3000 2>/dev/null; then
echo "Authguard is ready! Starting nginx..."
nginx -g 'daemon off;'
exit 0
fi
echo "Still waiting for authguard..."
sleep 10
done
profiles:
- prod
- dev
- local
authguard:
build:
context: ./AuthGuard
dockerfile: Dockerfile
container_name: authguard
ports:
- "3000:3000"
env_file: ./AuthGuard/.env
depends_on:
- redis
- keycloak
networks:
- authguard-network
profiles:
- prod
authguard-dev:
build:
context: ./AuthGuard
dockerfile: Dockerfile.dev
container_name: authguard
ports:
- "3000:3000"
env_file: ./AuthGuard/.env
environment:
- CARGO_WATCH_POLL=1
- CARGO_WATCH_POLL_INTERVAL=5
volumes:
- ./AuthGuard/src:/app/src
- ./AuthGuard/Cargo.toml:/app/Cargo.toml
- ./AuthGuard/Cargo.lock:/app/Cargo.lock
- target-cache:/app/target
depends_on:
- redis
- keycloak
networks:
- authguard-network
profiles:
- dev
user-service:
image: node:18-alpine
container_name: user_service
command: sh -c "echo 'const http = require(\"http\"); http.createServer((req, res) => { res.end(\"OK\"); }).listen(4001);' > server.js && node server.js"
networks:
- authguard-network
profiles:
- prod
- dev
- local
keycloak:
image: quay.io/keycloak/keycloak:25.0.6
container_name: keycloak_auth
command: start-dev --import-realm
env_file: ./AuthGuard/.env
environment:
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- KC_BOOTSTRAP_ADMIN_USERNAME=admin
- KC_BOOTSTRAP_ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin}
- KC_HOSTNAME_STRICT=false
- KC_PROXY=edge
- KC_HTTP_ENABLED=true
- KC_HTTP_RELATIVE_PATH=/auth
- JAVA_OPTS_APPEND=-Dkeycloak.migration.replace-placeholders=true
volumes:
- ./AuthGuard/keycloak:/opt/keycloak/data/import
- /etc/localtime:/etc/localtime:ro
ports:
- "8080:8080"
networks:
- authguard-network
profiles:
- prod
- dev
- local
redis:
image: redis:7-alpine
container_name: redis_cache
ports:
- "6379:6379"
networks:
- authguard-network
profiles:
- prod
- dev
- local
networks:
authguard-network:
driver: bridge
volumes:
target-cache: