-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
104 lines (103 loc) · 2.49 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
version: "3"
services:
postgreSQL:
image: postgres:9.5.17-alpine
container_name: postgreSQL
ports:
- 5432:5432
hostname: postgreSQL
volumes:
- postgreSQL_volume:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=postgres
networks:
webapp.net:
ipv4_address: 172.16.240.10
pgAdmin4:
image: dpage/pgadmin4
container_name: pgAdmin4
ports:
- 5050:80
environment:
- PGADMIN_DEFAULT_PASSWORD=alexork1973ut
- PGADMIN_LISTEN_ADDRESS=172.16.240.11
- PGADMIN_LISTEN_PORT=5050
depends_on:
- postgreSQL
networks:
webapp.net:
ipv4_address: 172.16.240.11
redis:
image: redis:5.0.7-alpine
container_name: redis
volumes:
- redis_volume:/usr/share/redis/data
ports:
- 6379:6379
networks:
webapp.net:
ipv4_address: 172.16.240.12
webapp: &default-webapp
build: .
stdin_open: true
tty: true
volumes:
- .:/app
ports:
- 3000:3000
- 3001:3001
- 3002:3002
- 5002:5002
depends_on:
- postgreSQL
- pgAdmin4
- redis
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_HOST=postgreSQL
- POSTGRES_PORT=5432
- REDIS_URL=http://172.16.240.12:6379
- REDIS_PORT=6379
networks:
webapp.net:
ipv4_address: 172.16.240.13
webapp_development:
<< : *default-webapp
command: >
bash -c "RAILS_ENV=development puma -C config/puma.rb
# Run development server detached"
networks:
webapp.net:
ipv4_address: 172.16.240.14
webapp_test:
<< : *default-webapp
command: >
bash -c "RAILS_ENV=test puma -b tcp://0.0.0.0:3001 &&
# Run test server with rspec detached
RAILS_ENV=test puma -b tcp://0.0.0.0:5002
# Run test server with cypress detached"
networks:
webapp.net:
ipv4_address: 172.16.240.15
webapp_production:
<< : *default-webapp
command: >
bash -c "RAILS_ENV=production puma -b tcp://0.0.0.0:3002 -d
# Run production server detached"
networks:
webapp.net:
ipv4_address: 172.16.240.16
networks:
webapp.net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.240.0/24
volumes:
postgreSQL_volume:
driver: local
redis_volume:
driver: local