-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
75 lines (71 loc) · 1.63 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: '3'
services:
postgres:
image: 'postgres:10'
restart: always
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=boilerplate
volumes:
- ./postgres-data/postgres:/var/lib/postgresql/data
ports:
- '5432:5432'
# redis-server:
# image: 'redis:latest'
# ports:
# - '6379:6379'
node-app:
build:
context: .
dockerfile: Dockerfile
ports:
- '8888:8888'
volumes:
- /usr/app/node_modules
- .:/usr/app
environment:
- NODE_ENV=development
- POSTGRES_DB=boilerplate
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
restart: always
depends_on:
- postgres
command: ./wait-for.sh postgres -- npm run dev
postgres-test:
image: 'postgres:10'
restart: always
environment:
- POSTGRES_DB=mytestdatabase
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
ports:
- '5431:5432'
node-app-test:
build:
context: .
dockerfile: Dockerfile
ports:
- '8881:8888'
volumes:
- /usr/app/node_modules
- .:/usr/app
environment:
- NODE_ENV=development
- TEST_DATABASE=mytestdatabase
- POSTGRES_DB=mytestdatabase
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
restart: always
depends_on:
- postgres-test
command: ./wait-for.sh postgres-test -- npm run test-server
### COMMAND HELPERS
## When there is a new package in the package.json
# docker-compose up --build
# docker-compose ps
## Launch in background
# docker-compose up -d
## Kill docker compose services
# docker-compose down