-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
53 lines (50 loc) · 1.69 KB
/
docker-compose.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
52
53
version: '3'
services:
app:
build: .
user: root
image: opillinois-api-app
depends_on:
- postgres
links:
- postgres
volumes:
- .:/usr/src/oneplace-illinois-api
- /usr/src/oneplace-illinois-api/node_modules
ports:
#- '80:80'
- '3000:3000' # for alternative local dev
networks:
- default
env_file:
- .env.docker # postgres env data & app's PORT
environment:
# https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds
# POSTGRES_HOST -- host.docker.internal (Docker figures out host for us) and avoid using 127.0.0.1 (localhost)
# POSTGRES_HOST: host.docker.internal
#POSTGRES_HOST: 172.17.0.1 # host.docker.internal doesn't work on older Docker or just doesn't work.
POSTGRES_HOST: postgres
# Run multiple commands
# *** use 'sh' since alpine doesn't support 'bash' ***
# 'npm i papaparse' because node throws error 'papaparse uninstalled' (even after npm ci). Idk why...
command: sh -c "
npm i papaparse
&& npm run parse-cis
&& npm start
"
postgres:
image: postgres:13.3-alpine
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data # persistent data
ports:
# change to "5435:5432" if the server's port 5435 is already being used (by another docker or local Postgres)
# then, make sure Sequelize connects to Postgres on port: 5435 (inside docker, Postgres runs on 5432)
# ** change at config/config.js -> postgres.sequelize_port: 5432 **
- "5432:5432"
networks:
- default
env_file:
- .env.docker # set up postgres (see .env.docker.example)
volumes:
db-data: