This repository has been archived by the owner on Jun 24, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
114 lines (106 loc) · 2.66 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
# This is a set up for 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
#
# Docker Compose 2.4 is for local development
# https://www.heroku.com/podcasts/codeish/57-discussing-docker-containers-and-kubernetes-with-a-docker-captain - Source on that.
version: '2.4'
x-app: &app
image: typo-ci:0.4.0
mem_limit: 512m
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
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:
condition: service_healthy
redis:
condition: service_started
services:
postgres:
image: postgres:12.3-alpine
mem_limit: 64m
volumes:
- postgresql:/var/lib/postgresql/data:delegated
ports:
- "127.0.0.1:5432:5432"
environment:
PSQL_HISTFILE: /root/log/.psql_history
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 2s
retries: 10
logging:
driver: none
redis:
image: redis:4.0.14-alpine
mem_limit: 64m
volumes:
- redis:/data:delegated
ports:
- "127.0.0.1:6379:6379"
restart: on-failure
logging:
driver: none
web:
<<: *app
command: bash -c "rm -rf /usr/src/app/tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
ports:
- "127.0.0.1:3000:3000"
ngrok:
image: wernight/ngrok
env_file:
- .env
environment:
NGROK_AUTH: "${NGROK_AUTH}"
NGROK_REGION: eu
NGROK_SUBDOMAIN: typoci
NGROK_HEADER: webhooks.typoci.test
NGROK_PORT: "web:3000"
worker:
<<: *app
command: bundle exec sidekiq -C config/sidekiq.yml
webpacker:
<<: *app
mem_limit: 256m
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: