-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-production.yml
56 lines (41 loc) · 1.25 KB
/
docker-compose-production.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
version: '2.1'
volumes:
postgres-data:
driver: local
services:
# service configuration for our web server
web:
# set the build context to the root of the Rails app
build:
context: .
# build with a different Dockerfile
dockerfile: config/containers/Dockerfile-nginx
# makes the web container aware of the app container
links:
- app
# expose the port we configured Nginx to bind to
ports:
- "80:80"
# service configuration for our dockerized Rails app
app:
# use the Dockerfile next to this file
build: .
# sources environment variable configuration for our app
env_file: .env
# rely on the RAILS_ENV value of the host machine
environment:
- RAILS_ENV=production
# makes the app container aware of the DB container
links:
- db
# expose the port we configured Unicorn to bind to
expose:
- "3000"
# service configuration for our database
db:
# use the preferred version of the official Postgres image
# see https://hub.docker.com/_/postgres/
image: postgres:9.4.5
# persist the database between containers by storing it in a volume
volumes:
- postgres-data:/var/lib/postgresql/data