-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
docker-compose.yml
92 lines (85 loc) · 2.24 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
---
# This is a set up for Ruby on Rails 6, running a worker & webpack.
# Gems are cached within a volume, which speeds up development when adding new gems.
#
## Usage:
#
# docker-compose build
# docker-compose run --rm web bin/setup
# docker-compose up
version: "3"
x-app: &app
build:
context: .
dockerfile: Dockerfile
target: development
tmpfs:
- /tmp
environment:
REDIS_URL: redis://@redis:6379/1
DATABASE_URL: postgres://postgres:postgres@postgres:5432/
WEBPACKER_DEV_SERVER_HOST: webpacker
entrypoint: ./bin/docker/entrypoints/wait-for-web.sh
volumes:
- .:/usr/src/app:cached
- bundler:/usr/local/bundle:delegated
- bootsnap_cache:/usr/src/bootsnap:delegated
- rails_cache:/usr/src/app/tmp/cache:delegated
- packs:/usr/src/app/public/packs:delegated
- node_modules:/usr/src/app/node_modules:delegated
- yarn_cache:/usr/src/yarn:delegated
- letter_opener:/usr/src/app/tmp/letter_opener:delegated
depends_on:
- postgres
- redis
services:
postgres:
image: postgres:13.2-alpine
volumes:
- postgresql:/var/lib/postgresql/data:delegated
# Uncomment to access this containers Postgres instance via port 5432
#ports:
#- "127.0.0.1:5432:5432"
environment:
PSQL_HISTFILE: /root/log/.psql_history
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: on-failure
logging:
driver: none
redis:
image: redis:6.0.12-alpine
volumes:
- redis:/data:delegated
# Uncomment to access this containers Redis instance via port 6379
#ports:
#- "127.0.0.1:6379:6379"
restart: on-failure
logging:
driver: none
web:
<<: *app
entrypoint: ./bin/docker/entrypoints/wait-for-postgres.sh
command: bash -c "./bin/docker/prepare-to-start-rails && ./bin/rails server -p 3000 -b '0.0.0.0'"
ports:
- "127.0.0.1:3000:3000"
worker:
<<: *app
command: bundle exec sidekiq -C config/sidekiq.yml
webpacker:
<<: *app
command: ./bin/webpack-dev-server
environment:
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0
ports:
- "127.0.0.1:3035:3035"
volumes:
postgresql:
redis:
bundler:
bootsnap_cache:
rails_cache:
packs:
node_modules:
yarn_cache:
letter_opener: