-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
50 lines (50 loc) · 1.72 KB
/
docker-compose.yaml
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
version: "3.8"
services:
database:
image: postgres:15-alpine
# Load all env vars from .env into the container's environment.
env_file: .env
ports:
- 5432:5432
volumes:
- pg-data:/var/lib/postgresql/data
- ./Server/src/Database/migration.sql:/docker-entrypoint-initdb.d/migration.sql
- ./Server/src/Database/seed.sql:/docker-entrypoint-initdb.d/seed.sql
- ./Server/src/scripts/student.csv:/docker-entrypoint-initdb.d/student.csv
- ./Server/src/scripts/interview.csv:/docker-entrypoint-initdb.d/interview.csv
command: >
bash -c "
docker-entrypoint.sh postgres && sleep 5 &&
echo '\\COPY students FROM \'/docker-entrypoint-initdb.d/student.csv\' WITH (FORMAT csv, DELIMITER ',');' >> /docker-entrypoint-initdb.d/seed.sql &&
echo '\\COPY interviewers FROM \'/docker-entrypoint-initdb.d/interview.csv\' WITH (FORMAT csv, DELIMITER ',');' >> /docker-entrypoint-initdb.d/seed.sql &&
docker-entrypoint.sh postgres"
server:
build: ./Server
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
NODE_ENV: development
PORT: 80
INTERVIEWER_TOKEN: special-awesome-stinky-smelly-super-secret-unique-access-token
depends_on:
- database
ports:
- ${API_PORT}:80
volumes:
- ./Server/src:/code/src
- /Server/node_modules
command: npm run dev
app:
build: ./client
environment:
API_URL: http://server
PORT: ${CLIENT_PORT}
depends_on:
- server
ports:
- ${CLIENT_PORT}:${CLIENT_PORT}
volumes:
- ./client:/code
- /client/node_modules
command: sh -c "npm rebuild esbuild && npm run dev"
volumes:
pg-data: