Repository navigation
Expand file tree
/
Copy pathdebug-compose.yml
More file actions
115 lines (110 loc) · 2.88 KB
/
Copy pathdebug-compose.yml
File metadata and controls
115 lines (110 loc) · 2.88 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
services:
blackboard-db:
image: blackboard-db
pull_policy: build
init: true
build:
context: ./db
args:
- TZ=${TZ}
container_name: blackboard-db
volumes:
- bbdata:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: blackboard
POSTGRES_DB: blackboard
TZ: ${TZ}
PGTZ: ${TZ}
networks:
- database
# Node.js backend
blackboard-server:
build:
context: ./server
target: dev
image: blackboard-server
pull_policy: build
init: true
container_name: blackboard-server
# restart not defined as we want to fix issues before restarting, and nodemon will handle
# this once the source code has been modified
ports:
- ${NODE_PORT_DEV}:${NODE_PORT_DEV}
- "9229:9229" # node.js debugging port
volumes:
- ./server/src:/srv/app/server/src
- ./server/public:/srv/app/server/public:consistent
depends_on:
blackboard-db:
condition: service_started
environment:
NODE_SERVER_PORT: ${NODE_PORT_DEV}
HOME: /home
TZ: ${TZ}
# cert paths not needed here as we run over http
networks:
- app
- database
command: npm run dev
#command: # startup command for debugging node.js
#- node
#- "--inspect-brk=0.0.0.0"
#- "."
# One-shot backend test runner: docker compose --profile test run --rm blackboard-server-test
# Runs the vitest suite from server/test against the in-memory fake database.
blackboard-server-test:
profiles: ["test"]
build:
context: ./server
target: dev
image: blackboard-server
pull_policy: build
container_name: blackboard-server-test
volumes:
- ./server/src:/srv/app/server/src
- ./server/test:/srv/app/server/test
- ./server/vitest.config.js:/srv/app/server/vitest.config.js
environment:
HOME: /home
TZ: ${TZ}
networks:
- app
- database
command: npm test
# React frontend
blackboard-client:
build:
context: ./client
target: build-deps # Don't use nginx in development, only build the first step
args:
USE_NGINX: "false"
image: blackboard-client
pull_policy: build
container_name: blackboard-client
init: true
ports:
- ${VITE_PORT}:${VITE_PORT}
volumes:
- ./client/src:/srv/app/client/src
#- ./client/public:/srv/app/client/public
environment:
VITE_PORT: ${VITE_PORT}
PORT: ${VITE_PORT} # npm run start uses the PORT defined here
HOME: /home
TZ: ${TZ}
depends_on:
blackboard-server:
condition: service_started
networks:
- app
#user: $USER_ID
stdin_open: true
command: npm run start # run the hot-reloading version in development
volumes:
bbdata:
networks:
app:
driver: bridge
database:
driver: bridge