-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
52 lines (48 loc) · 1.57 KB
/
docker-compose.yaml
File metadata and controls
52 lines (48 loc) · 1.57 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
services:
postgres:
image: postgres:17
# Inject into the container the database credentials and configuration variables defined in the .env file
# (database names , database user, host and port mappings)
# as environment variables.
# This is required for the docker init script in ./docker/init/.
env_file:
- .env
networks:
- net
volumes:
# Init scripts: run once on first container start (empty data dir).
- ./docker/init:/docker-entrypoint-initdb.d
# Named volume: preserves data across container stop/start cycles.
- pg_data:/var/lib/postgresql/data
ports:
# See src/main/resources/.env.example for details
- "${POSTGRES_HOST}:${POSTGRES_PORT}:5432"
mongo:
image: mongo:8.0
restart: unless-stopped
ports:
- "${MONGO_HOST}:${MONGO_PORT}:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: ${LEARNDEV_MONGO_DB_NAME}
volumes:
- mongo_data:/data/db
- ./docker/mongo/init:/docker-entrypoint-initdb.d:ro
networks:
- net
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
net:
# A bridge network connects your services together
# on an isolated Virtual LAN managed by Docker.
driver: bridge
# Named volumes used to preserve data across container stop/start cycles.
volumes:
pg_data:
mongo_data: