-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
122 lines (116 loc) · 2.73 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
services:
postgres:
command: -c 'max_connections=1000'
networks:
- battle-stadium-network
image: postgres:16
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DATABASE=fuecoco-db-dev
ports:
- 5432:5432
redis:
networks:
- battle-stadium-network
image: redis:7
restart: unless-stopped
ports:
- 6379:6379
sidekiq:
networks:
- battle-stadium-network
image: thatguyinabeanie/battle-stadium:dev-latest
command: zsh -c "(bundle check || bundle install) && bundle exec sidekiq"
environment:
RAILS_ENV: development
ADMIN_BYPASS: "true"
REDIS_URL: redis://redis:6379/1
ports:
- 10001:3000
depends_on:
- postgres
- redis
- backend
volumes:
- .:/battle-stadium
- .zshrc:/root/.zshenv
- .zshrc:/root/.zshrc
# RAILS API - DEVELOPMENT CONTAINER
backend:
networks:
- battle-stadium-network
hostname: rails-api-container
image: thatguyinabeanie/battle-stadium:dev-latest
environment:
RAILS_ENV: development
PORT: 10000
AUTO_START_RAILS: "true"
ADMIN_BYPASS: "true"
REDIS_URL: redis://redis:6379/1
build:
dockerfile: Dockerfile.dev
target: development
tags:
- thatguyinabeanie/battle-stadium:dev-latest
cache_from:
- thatguyinabeanie/battle-stadium:dev-latest
tty: true
stdin_open: true
ports:
- 10000:10000
depends_on:
- postgres
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://backend:10000/up"]
interval: 60s
timeout: 10s
retries: 3
start_period: 120s
volumes:
- .:/battle-stadium
- ./.zshrc:/root/.zshenv
- ./.zshrc:/root/.zshrc
# RAILS API - PRODUCTION CONTAINER
backend-prod:
networks:
- battle-stadium-network
profiles:
- production
hostname: rails-api-container
platform: linux/amd64
environment:
RAILS_ENV: production
PORT: 10000
build:
dockerfile: Dockerfile.prod
target: production
tags:
- thatguyinabeanie/battle-stadium:latest
cache_from:
- thatguyinabeanie/battle-stadium:prod-cache-latest
tty: true
stdin_open: true
ports:
- 10000:10000
env_file:
- .env
depends_on:
- postgres
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:10001/up"]
interval: 60s
timeout: 10s
retries: 3
start_period: 120s
volumes:
postgres-data:
networks:
battle-stadium-network:
name: battle-stadium-network
external: true