-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
71 lines (66 loc) · 1.63 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
---
# 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: hanami-app:latest
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/
volumes:
- .:/usr/src/app:cached
- bundler:/usr/local/bundle:delegated
- node_modules:/usr/src/app/node_modules:delegated
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
services:
postgres:
image: postgres:12.3-alpine
mem_limit: 64m
volumes:
- ./log:/root/log:cached
- 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 hanami server --port=3000 --host=0.0.0.0"
ports:
- "127.0.0.1:${PORT:-3000}:3000"
volumes:
postgresql:
redis:
bundler:
node_modules: