File tree Expand file tree Collapse file tree 2 files changed +17
-27
lines changed Expand file tree Collapse file tree 2 files changed +17
-27
lines changed Original file line number Diff line number Diff line change 1
- # Configuration for Hanami environment
2
- # REDIS_URL=
3
- # DATABASE_URL=
1
+ # If you want, you can run:
2
+ # $ docker compose up redis postgres
3
+ # $ bundle exec rails s
4
+ # I know for some people it's a little more performant :)
5
+ REDIS_URL = redis://@127.0.0.1:6379/1
6
+ DATABASE_URL = postgres://postgres:[email protected] :5432/
4
7
5
8
# Adhoc ENVs
6
9
LANG = en_US.UTF-8
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ x-app: &app
10
10
context : .
11
11
dockerfile : Dockerfile
12
12
target : development
13
- env_file :
14
- - .env
13
+ tmpfs :
14
+ - /tmp
15
15
environment :
16
16
REDIS_URL : redis://@redis:6379/1
17
17
DATABASE_URL : postgres://postgres:postgres@postgres:5432/
@@ -30,52 +30,39 @@ services:
30
30
image : postgres:12.3-alpine
31
31
mem_limit : 64m
32
32
volumes :
33
+ - ./log:/root/log:cached
33
34
- postgresql:/var/lib/postgresql/data:delegated
34
- # Alternative if you want to store your postgres data outside of a volume
35
- # - ~/.docker-data/hanami-app/postgresql:/var/lib/postgresql/data:delegated
36
- # ports:
37
- # - 5432
35
+ ports :
36
+ - " 127.0.0.1:5432:5432"
38
37
environment :
38
+ PSQL_HISTFILE : /root/log/.psql_history
39
39
POSTGRES_USER : postgres
40
40
POSTGRES_PASSWORD : postgres
41
41
restart : on-failure
42
42
healthcheck :
43
43
test : ["CMD-SHELL", "pg_isready -U postgres"]
44
44
interval : 10s
45
- timeout : 5s
46
- retries : 5
45
+ timeout : 2s
46
+ retries : 10
47
47
logging :
48
48
driver : none
49
49
50
50
redis :
51
51
image : redis:4.0.14-alpine
52
52
mem_limit : 64m
53
- command : >
54
- --save
55
- --maxmemory 128mb
56
- --maxmemory-policy noeviction
57
- --stop-writes-on-bgsave-error yes
58
- --rdbcompression yes
59
- --rdbchecksum yes
60
- --dir /data
61
53
volumes :
62
54
- redis:/data:delegated
63
- # ports:
64
- # - 6379
55
+ ports :
56
+ - " 127.0.0.1: 6379:6379 "
65
57
restart : on-failure
66
- healthcheck :
67
- test : ["CMD", "redis-cli", "ping"]
68
- interval : 10s
69
- timeout : 5s
70
- retries : 5
71
58
logging :
72
59
driver : none
73
60
74
61
web :
75
62
<< : *app
76
63
command : bash -c "rm -rf /usr/src/app/tmp/pids/server.pid && bundle exec hanami server --port=3000 --host=0.0.0.0"
77
64
ports :
78
- - " ${PORT:-3000}:3000"
65
+ - " 127.0.0.1: ${PORT:-3000}:3000"
79
66
80
67
volumes :
81
68
postgresql :
You can’t perform that action at this time.
0 commit comments