-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
130 lines (123 loc) · 2.86 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
services:
app:
build:
context: .
dockerfile: Dockerfile
image: gym_tracker-dev
init: true
profiles: [server, migrations]
depends_on:
db:
condition: service_healthy
tty: true
stdin_open: true
command: 'bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b 0.0.0.0"'
volumes: &app_volumes
- .:/rails
- bundle_data:/usr/local/bundle
ports:
- "3000:3000"
environment: &app_environment
RAILS_ENV: development
DATABASE_URL: postgres://postgres:password@db:5432/gym_trackr_development
ECDSA_KEY: ${ECDSA_KEY}
networks:
- gym_trackr_network
db:
image: postgres:latest
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: gym_trackr_development
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
networks:
- gym_trackr_network
profiles: [server, migrations, test]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 3
ports:
- "5432:5432"
solid_queue_worker:
build:
context: .
dockerfile: Dockerfile
stdin_open: true
tty: true
image: gym_tracker-dev
command: bundle exec rake solid_queue:work
depends_on:
- db
networks:
- gym_trackr_network
profiles: [server, test]
volumes: *app_volumes
environment: *app_environment
app-test:
build:
context: .
dockerfile: Dockerfile
image: gym_tracker-test
init: true
depends_on:
db:
condition: service_healthy
solid_queue_worker:
condition: service_started
tty: true
stdin_open: true
command: bundle exec rails s -p 3001 -b '0.0.0.0'
volumes:
- .:/rails
- bundle_data_test:/usr/local/bundle
ports:
- "3001:3000"
profiles: [test]
environment:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:password@db:5432/gym_trackr_test
ECDSA_KEY: ${ECDSA_KEY}
networks:
- gym_trackr_network
frontend:
build:
context: frontend
dockerfile: Dockerfile
image: gym_tracker-frontend
tty: true
stdin_open: true
profiles: [server]
networks:
- gym_trackr_network
ports:
- "4000:4000"
volumes:
- ./frontend:/app
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin4_container
restart: always
ports:
- "8888:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: password
profiles: [pgadmin]
volumes:
- pgadmin:/var/lib/pgadmin
- ./pgadmin/config/servers.json:/pgadmin4/servers.json
networks:
- gym_trackr_network
networks:
gym_trackr_network:
driver: bridge
volumes:
postgres_data:
postgres_data_test:
frontend:
pgadmin:
bundle_data:
bundle_data_test: