-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
98 lines (91 loc) · 1.89 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
services:
rails:
build:
context: ./backend
dockerfile: Dockerfile
image: song-list-rails
container_name: song-list-rails
depends_on:
- db
env_file:
- ./backend/.env
environment:
- RAILS_ENV=production
volumes:
- public:/app/public
tmpfs:
- /app/tmp/pids
migrate:
container_name: song-list-migrate
image: song-list-rails
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- ./backend/.env
environment:
- RAILS_ENV=production
command: bundle exec rails db:migrate
depends_on:
- db
sidekiq:
container_name: song-list-sidekiq
build:
context: ./backend
dockerfile: Dockerfile
restart: always
env_file:
- ./backend/.env
environment:
- RAILS_ENV=production
command: bundle exec sidekiq
depends_on:
- redis
- db
next:
container_name: song-list-next
image: song-list-next
env_file:
- ./frontend/.env
build:
args:
- BACKEND_HOST=http://rails:3000
context: ./frontend
dockerfile: Dockerfile
restart: always
depends_on:
- rails
db:
image: postgres:15.10-alpine
restart: always
container_name: song-list-postgres
volumes:
- database:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: song_list_production
redis:
image: redis:alpine
container_name: song-list-redis
restart: always
volumes:
- redis-data:/var/lib/redis
nginx:
container_name: song-list-nginx
build:
context: ./nginx
dockerfile: Dockerfile
restart: always
ports:
- 54020:3080
- 54030:4080
depends_on:
- rails
- next
volumes:
- public:/app/public
volumes:
database:
public:
redis-data: