-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
99 lines (88 loc) · 2.23 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
# docker-compose build app
# docker-compose up
# docker-compose run --rm app bundle # Gemfile change
# docker compose exec app rake db:create
# docker compose exec -e EDITOR=vi app rails credentials:edit
# https://gist.github.com/erdostom/5dd400cbba17d44b52b2f74b038fcb85
version: '3.7'
services:
app:
image: nkcr/resj:v1
build:
context: .
command: ["spring", "server"]
environment:
- POSTGRES_HOST=pg
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=secret
- RAILS_ENV=development
volumes:
- ./:/usr/src/app
- gems:/usr/local/bundle
- node-modules:/usr/src/app/node_modules
- ${HOME}/.irbrc:/root/.irbrc
- ${HOME}/.irb-history:/root/.irb-history
web:
image: nkcr/resj:v1
command: >
bash -c "while !</dev/tcp/pg/5432; do sleep 1; done;
bundle exec rails s -b 0.0.0.0"
environment:
- POSTGRES_HOST=pg
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=secret
- RAILS_ENV=development
volumes:
- ./:/usr/src/app
- gems:/usr/local/bundle
- node-modules:/usr/src/app/node_modules
ports:
- 3000:3000
pg:
image: postgres:11.2-alpine
volumes:
- ./data/postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=secret
webpacker:
image: nkcr/resj:v1
command: ./bin/webpack-dev-server --color
volumes:
- ./:/usr/src/app
- gems:/usr/local/bundle
- node-modules:/usr/src/app/node_modules
ports:
- 3035:3035
volumes:
gems:
node-modules:
# version: '3.0'
# services:
# db:
# image: postgres:10
# ports:
# - 5432:5432
# environment:
# POSTGRES_PASSWORD: ${DB_USER_PASSWORD}
# webpacker:
# image: nkcr/resj:v1
# command: ["./scripts/start_webpack_dev.sh"]
# volumes:
# - .:/opt/dockerrailsdemo:cached
# ports:
# - 3035:3035
# web:
# image: nkcr/resj:v1
# build:
# context: .
# args:
# precompileassets: 'not'
# links:
# - db
# - webpacker
# ports:
# - 3000:3000
# command: ["./scripts/wait-for-it.sh", "db:5432", "--", "./scripts/start_rails.sh"]
# volumes:
# - .:/opt/dockerrailsdemo:cached