-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
62 lines (58 loc) · 1.43 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
data:
image: gliderlabs/alpine
command: echo Data Container
user: 999:999
labels:
com.dockerinaction.chapter: "11"
com.dockerinaction.example: "Coffee API"
com.dockerinaction.role: "Volume Container"
dbstate:
extends:
file: docker-compose.yml
service: data
volumes:
- /var/lib/postgresql/data/pgdata
# the postgres image uses gosu to change to the postgres user
db:
image: postgres
volumes_from:
- dbstate
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=development
labels:
com.dockerinaction.chapter: "11"
com.dockerinaction.example: "Coffee API"
com.dockerinaction.role: "Database"
# the nginx image uses user de-escalation to change to the nginx user
proxy:
image: nginx
restart: always
volumes:
- ./proxy/app.conf:/etc/nginx/conf.d/app.conf
ports:
- "8080:8080"
links:
- coffee
labels:
com.dockerinaction.chapter: "11"
com.dockerinaction.example: "Coffee API"
com.dockerinaction.role: "Load Balancer"
coffee:
build: ./coffee
user: 777:777
restart: always
expose:
- 3000
ports:
- "0:3000"
links:
- db:db
environment:
- COFFEEFINDER_DB_URI=postgresql://postgres:development@db:5432/postgres
- COFFEEFINDER_CONFIG=development
- SERVICE_NAME=coffee
labels:
com.dockerinaction.chapter: "11"
com.dockerinaction.example: "Coffee API"
com.dockerinaction.role: "Application Logic"