-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
140 lines (130 loc) · 3.39 KB
/
docker-compose.yml
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
# Common configuration between services
x-frontend: &frontend-base
build:
context: ./frontend
ports:
- "8888:8888"
x-backend: &backend-base
ports:
- "5001:80"
- "5000:443"
environment:
ASPNETCORE_ENVIRONMENT: "Development"
ConnectionStrings__KSummarized: "Host=db;Database=ksummarized;Username=${POSTGRES_USER};Password=${POSTGRES_PASSWORD}"
ASPNETCORE_Kestrel__Certificates__Default__Path: "/https/aspnetapp.pfx"
ASPNETCORE_Kestrel__Certificates__Default__Password: "devcertpasswd"
ASPNETCORE_URLS: "https://+:443;http://+:80"
DOTNET_USE_POLLING_FILE_WATCHER: true # dotnet watch uses a a polling file watcher. Required for running it in docker.
volumes:
- .aspnet/https:/https/:ro # read-only on the container
services:
frontend:
<<: *frontend-base
container_name: ks-frontend
profiles:
- without-hot-reload
frontend-hot-reload:
<<: *frontend-base
container_name: ks-frontend-hot-reload
profiles:
- hot-reload
command: ["npm", "run", "dev"]
develop:
watch:
- action: sync
path: ./frontend
target: /src
ignore:
- node_modules
- action: rebuild
path: package.json
backend:
<<: *backend-base
container_name: ks-backend
build:
context: ./backend
target: final
profiles:
- without-hot-reload
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
backend-hot-reload:
<<: *backend-base
container_name: ks-backend-hot-reload
build:
context: ./backend
target: development
profiles:
- hot-reload
depends_on:
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
develop:
watch:
- action: sync
path: ./backend
target: /src
migrations:
<<: *backend-base
container_name: ks-migrations
restart: no
build:
context: ./backend
target: migrations
depends_on:
db:
condition: service_healthy
db:
image: postgres:14.0-alpine
container_name: ks-database
ports:
- "5432:5432"
volumes:
- ks_postgresql:/var/lib/postgresql/data
- ./scripts/seed.sql:/docker-entrypoint-initdb.d/seed.sql
env_file: .env
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER}'"]
interval: 3s
timeout: 5s
retries: 3
keycloak:
build:
context: ./keycloak
container_name: ks-keycloak
command: start-dev --import-realm
env_file: .env
ports:
- "8080:8080"
volumes:
- ./keycloak/imports/realms/realm-export.json:/opt/keycloak/data/import/realm-export.json
- ./keycloak/imports/providers:/opt/keycloak/providers/
- ./keycloak/themes/ksummarized:/opt/keycloak/themes/ksummarized/
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
# fake SMTP server to send emails
smtp4dev:
image: rnwood/smtp4dev:v3.1
container_name: ks-smtp4dev
ports:
- "5050:80"
- "25:25"
- "143:143"
volumes:
- smtp4dev-data:/smtp4dev
environment:
- ServerOptions__HostName=smtp4dev
volumes:
ks_postgresql:
smtp4dev-data: