-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdocker-compose.yml
57 lines (54 loc) · 1.28 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
version: "3.5"
volumes:
bundle:
driver: local
mysql:
driver: local
tmp:
driver: local
node-modules:
driver: local
services:
app:
build:
args:
BUNDLE_WITHOUT: "darwin"
RAILS_ENV: development
target: base
context: .
image: "my-app:1.0"
# so things like pry work
tty: true
stdin_open: true
volumes:
# bind-mount your working directory of code
- .:/home/app
# attach a volume at /bundle to keep gems outside of the container image
- bundle:/bundle
# attach a volume at ./node_modules to keep node modules cached in a volume
- node-modules:/home/app/node_modules
# attach a volume at ./tmp to cache asset compilation, rails cache files
- tmp:/home/app/tmp
environment:
- RAILS_ENV=development
- MYSQL_HOST=mysql
- MYSQL_USER=root
- MYSQL_PASSWORD=root
- BUNDLE_PATH=/bundle
- BUNDLE_JOBS=2
- BUNDLE_RETRY=3
ports:
- "3000:3000"
links:
- mysql
mysql:
image: mysql:8.0.21
command:
- --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=app_development
ports:
- "3306:3306"
volumes:
- mysql:/var/lib/mysql