rabil commited on
Commit
be8afd0
β€’
1 Parent(s): 794c5a3

chore: Update Dockerfile to use slim version of Elixir image and add supervisor configuration for Redis and SRH

Browse files
Files changed (3) hide show
  1. Dockerfile +16 -2
  2. README.md +11 -0
  3. docker/supervisor.conf +26 -0
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM elixir:1.13.4-alpine AS builder
2
 
3
  WORKDIR /app
4
 
@@ -16,11 +16,25 @@ COPY config/ ./config/
16
  ENV MIX_ENV=prod
17
  RUN mix release
18
 
19
- FROM elixir:1.13.4-alpine
20
 
21
  WORKDIR /app
22
 
23
  COPY --from=builder /app/_build/prod/rel/prod/ ./_build/prod/rel/prod/
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ENV MIX_ENV=prod
26
  CMD ["_build/prod/rel/prod/bin/prod", "start"]
 
1
+ FROM elixir:1.13.4-slim AS builder
2
 
3
  WORKDIR /app
4
 
 
16
  ENV MIX_ENV=prod
17
  RUN mix release
18
 
19
+ FROM elixir:1.13.4-slim
20
 
21
  WORKDIR /app
22
 
23
  COPY --from=builder /app/_build/prod/rel/prod/ ./_build/prod/rel/prod/
24
 
25
+ ARG SRH_MODE
26
+ ENV SRH_MODE=${SRH_MODE}
27
+
28
+ ARG SRH_TOKEN
29
+ ENV SRH_TOKEN=${SRH_TOKEN}
30
+
31
+ ENV SRH_CONNECTION_STRING="redis://127.0.0.1:6379"
32
+
33
+ ENV SRH_PORT=7860
34
+ EXPOSE 7860
35
+
36
+ COPY docker/supervisor.conf /etc/supervisor/conf.d/supervisor.conf
37
+
38
+
39
  ENV MIX_ENV=prod
40
  CMD ["_build/prod/rel/prod/bin/prod", "start"]
README.md CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  # Serverless Redis HTTP (SRH)
2
 
3
  A Redis proxy and connection pooler that uses HTTP rather than the Redis binary protocol.\
 
1
+ ---
2
+ title: Kv
3
+ emoji: πŸ“ˆ
4
+ colorFrom: purple
5
+ colorTo: pink
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ app_port: 7860
10
+ ---
11
+
12
  # Serverless Redis HTTP (SRH)
13
 
14
  A Redis proxy and connection pooler that uses HTTP rather than the Redis binary protocol.\
docker/supervisor.conf ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [supervisord]
2
+ nodaemon=true
3
+ redirect_stderr=true
4
+ redirect_stdout=true
5
+ stdout_logfile=/dev/stdout
6
+ stdout_logfile_maxbytes=0
7
+
8
+ [program:redis]
9
+ command=redis-server --bind 127.0.0.1 --port 6379
10
+ autostart=true
11
+ autorestart=true
12
+ startretries=3
13
+ redirect_stderr=true
14
+ redirect_stdout=true
15
+ stdout_logfile=/dev/stdout
16
+ stdout_logfile_maxbytes=0
17
+
18
+ [program:srh]
19
+ command=_build/prod/rel/prod/bin/prod start
20
+ autostart=true
21
+ autorestart=true
22
+ startretries=3
23
+ redirect_stderr=true
24
+ redirect_stdout=true
25
+ stdout_logfile=/dev/stdout
26
+ stdout_logfile_maxbytes=0