-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
51 lines (47 loc) · 1.93 KB
/
docker-compose.dev.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
# As of May 2024, docker-compose is not used to build GLADOS. This can be removed in the future.
# Use this docker-compose file in addition to the base one in order to set up development configurations for the containers
# https://docs.docker.com/compose/extends/
version: '3'
name: glados-project
services:
app-backend:
build:
target: development
volumes:
# Directly mount source code on host machine disk to container -> no need to rebuild container on every change
- ./apps/backend/:/app
app-frontend:
build:
target: development
volumes:
# Directly mount source code on host machine disk to container -> no need to rebuild container on every change
- ./apps/frontend/:/app
app-mongodb:
# Only expose the MongoDB port to the host machine during development (for testing)
# because end users should access it via frontend webserver api routes instead
ports:
- ${MONGODB_PORT}:${MONGODB_PORT}
# Quiet the logging prints because they are super noisy, especially due to the healthcheck
command: mongod --quiet --logpath /dev/null
# Need a healthcheck defined for to ensure the mongo-express instance starts up after this one
healthcheck:
# Based on https://stackoverflow.com/a/73783213/12693560
test: echo 'db.runCommand("ping").ok' | mongosh localhost:${MONGODB_PORT}/test --quiet
interval: 5s
timeout: 10s
retries: 5
start_period: 5s
app-mongoexpress:
# Development-only interface to view the mongodb contents
# Based on https://gist.github.com/adamelliotfields/cd49f056deab05250876286d7657dc4b
image: mongo-express
container_name: glados-DEVONLY-mongodb-express
environment:
ME_CONFIG_MONGODB_SERVER: $CONTACT_MONGODB_AT
ME_CONFIG_MONGODB_PORT: "${MONGODB_PORT}"
ME_CONFIG_OPTIONS_EDITORTHEME: "darcula"
depends_on:
app-mongodb:
condition: service_healthy
ports:
- 8081:8081