-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
108 lines (103 loc) · 2.78 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
108 lines (103 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
services:
db:
image: postgres:15-alpine
container_name: taskflow_db
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
keycloak-db:
image: postgres:15
container_name: taskflow_keycloak_db
environment:
POSTGRES_DB: ${KEYCLOAK_DB_NAME}
POSTGRES_USER: ${KEYCLOAK_DB_USER}
POSTGRES_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
volumes:
- keycloak-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${KEYCLOAK_DB_USER} -d ${KEYCLOAK_DB_NAME}"]
interval: 30s
timeout: 10s
retries: 5
keycloak:
container_name: taskflow_keycloak
build:
context: .
dockerfile: packages/infra/keycloak/Containerfile
env_file:
- ./packages/infra/keycloak/.env
environment:
# Admin credentials
KC_BOOTSTRAP_ADMIN_USERNAME: ${KC_ADMIN_USERNAME:-admin}
KC_BOOTSTRAP_ADMIN_PASSWORD: ${KC_ADMIN_PASSWORD:-change_me}
# Database connection (injected at runtime)
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://keycloak-db:5432/${KEYCLOAK_DB_NAME}
KC_DB_USERNAME: ${KEYCLOAK_DB_USER}
KC_DB_PASSWORD: ${KEYCLOAK_DB_PASSWORD}
KC_HOSTNAME: ${KC_HOSTNAME:-localhost}
ports:
- "8081:8080"
depends_on:
keycloak-db:
condition: service_healthy
command:
- start
- --hostname=localhost
- --http-enabled=true
- --db=postgres
- --features=token-exchange
- --db-url=jdbc:postgresql://keycloak-db:5432/keycloak
- --db-username=keycloak
- --db-password=password
api:
container_name: taskflow_api
build:
context: .
dockerfile: apps/api/Dockerfile
target: runner
args:
DATABASE_URL: ${DATABASE_URL} # build-time
volumes:
- ./apps/api:/usr/src/app/apps/api
- ./node_modules:/usr/src/app/node_modules
ports:
- "8080:8080"
env_file:
- ./apps/api/.env
environment:
# only values needed from infra / compose:
DATABASE_URL: ${DATABASE_URL}
# KEYCLOAK_REALM, KEYCLOAK_RESOURCE, secrets come from .env.api
depends_on:
db:
condition: service_healthy
web:
container_name: taskflow_web
build:
context: .
dockerfile: apps/web/Dockerfile
target: runner
args:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
ports:
- "3000:3000"
env_file:
- ./apps/web/.env
environment:
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
depends_on:
- api
volumes:
db-data:
keycloak-db-data: