-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
48 lines (44 loc) · 1.06 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
version: "3.7"
services:
postgres:
container_name: postgres
image: postgres
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
ports:
- ${DB_PORT:-5432:5432}
volumes:
- postgres-db:/var/lib/postgresql/data
express-api:
container_name: express-api
build:
context: ./api
environment:
DB_SCHEMA: postgres
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: postgres
depends_on:
- postgres
ports:
- "5000:5000"
volumes:
- ./api:/api
- /api/node_modules
react-ui:
container_name: react-ui
stdin_open: true
build:
context: ./client
environment:
CHOKIDAR_USEPOLLING: "true"
ports:
- "3000:3000"
volumes:
- ./client:/client
- /client/node_modules
volumes:
postgres-db:
# docker-compose run express-api npm run migrate (run migrations within container to build image, create persistent data volume and create table)
# docker-compose up