-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
52 lines (48 loc) · 1.25 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
version: '3.1'
services:
backend:
image: ruby:2.7.3
working_dir: "/app"
container_name: library_on_rails_backend
volumes:
- ./backend:/app
- /app/tmp
- gems:/usr/local/bundle
ports:
- "3002:3002"
- "3035:3035"
command: "bash -c 'rm -rf ./tmp/pids/server.pid; rm -rf tmp/cache/bootsnap-*; bundle exec bin/rails s -b 0.0.0.0 -p 3002'"
depends_on:
- mysql
environment:
- SECRET_HASH=${SECRET_HASH}
- API_URL=${API_URL-http://127.0.0.1:3002/api}
- DATABASE_HOST=mysql
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- RAILS_ENV=development
frontend:
image: node:latest
working_dir: "/app"
container_name: library_on_rails_frontend
volumes:
- ./frontend:/app
ports:
- "3000:3000"
command: "bash -c 'npm start'"
depends_on:
- backend
environment:
- REACT_APP_API_URL=${API_URL-http://127.0.0.1:3002/api}
- HOST=0.0.0.0
- PORT=3000
mysql:
image: mysql:8.0.23
container_name: ruby-on-rails-library_on_rails_mysql
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=${DATABASE_PASSWORD}
volumes:
- mysql:/var/lib/mysql
volumes:
gems:
mysql: