-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
175 lines (166 loc) · 4.71 KB
/
docker-compose.dev.yml
File metadata and controls
175 lines (166 loc) · 4.71 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
services:
mongodb:
container_name: freshly-mongodb
image: mongo:8
command: >
bash -c "
if [ ! -f /data/db/keyfile ]; then
openssl rand -base64 756 > /data/db/keyfile
chmod 400 /data/db/keyfile
fi
exec mongod --replSet rs0 --bind_ip_all --keyFile /data/db/keyfile
"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_DATABASE: freshly_db
ports:
- "27017:27017"
volumes:
- mongodb-data:/data/db
networks:
- freshly
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/admin -u root -p root --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
mongodb-init:
image: mongo:8
container_name: freshly-mongodb-init
depends_on:
mongodb:
condition: service_healthy
networks:
- freshly
restart: "no"
entrypoint: >
mongosh --host mongodb:27017 -u root -p root --eval
"try { rs.status(); print('replica set already initialized'); }
catch(e) { rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'mongodb:27017'}]}); print('replica set initialized'); }"
test-mongodb:
container_name: freshly-mongodb-test
image: mongo:8
command: >
bash -c "
if [ ! -f /data/db/keyfile ]; then
openssl rand -base64 756 > /data/db/keyfile
chmod 400 /data/db/keyfile
fi
exec mongod --replSet rs0 --bind_ip_all --keyFile /data/db/keyfile
"
environment:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test
MONGO_INITDB_DATABASE: test_db
ports:
- "27018:27017"
volumes:
- mongodb-test-data:/data/db
networks:
- freshly
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/admin -u test -p test --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
test-mongodb-init:
image: mongo:8
container_name: freshly-mongodb-test-init
depends_on:
test-mongodb:
condition: service_healthy
networks:
- freshly
restart: "no"
entrypoint: >
mongosh --host test-mongodb:27017 -u test -p test --eval
"try { rs.status(); print('replica set already initialized'); }
catch(e) { rs.initiate({_id: 'rs0', members: [{_id: 0, host: 'test-mongodb:27017'}]}); print('replica set initialized'); }"
mongo-express:
image: mongo-express:latest
container_name: freshly-mongo-express
restart: always
ports:
- "8081:8081"
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: root
ME_CONFIG_MONGODB_URL: mongodb://root:root@mongodb:27017/
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: admin
depends_on:
mongodb:
condition: service_healthy
networks:
- freshly
keycloak:
container_name: freshly-keycloak
image: quay.io/keycloak/keycloak:26.5.5
command: start-dev --import-realm
environment:
KC_DB: postgres
KC_DB_URL_HOST: keycloak-db
KC_DB_URL_DATABASE: keycloak_db
KC_DB_USERNAME: keycloak_user
KC_DB_PASSWORD: keycloak_pass
KC_DB_SCHEMA: public
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
KC_PROXY_HEADERS: xforwarded
KC_HOSTNAME_STRICT: "false"
KC_HTTP_ENABLED: "true"
KC_HEALTH_ENABLED: "true"
ports:
- "9000:8080"
volumes:
- ./docker/keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro
depends_on:
keycloak-db:
condition: service_healthy
networks:
- freshly
healthcheck:
test: [ "CMD-SHELL", "{ printf 'HEAD /health/ready HTTP/1.0\\r\\n\\r\\n' >&0; grep 'HTTP/1.0 200'; } 0<>/dev/tcp/localhost/9000" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
keycloak-db:
image: postgres:17-alpine
container_name: freshly-keycloak-postgres
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_DB: keycloak_db
POSTGRES_USER: keycloak_user
POSTGRES_PASSWORD: keycloak_pass
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- freshly
healthcheck:
test: ["CMD-SHELL", "pg_isready -U keycloak_user -d keycloak_db"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
mail-dev:
image: maildev/maildev:latest
container_name: freshly-mail-dev
restart: always
ports:
- "1025:1025"
- "1080:1080"
networks:
- freshly
volumes:
mongodb-data:
mongodb-test-data:
postgres-data:
networks:
freshly:
driver: bridge