Skip to content

Commit abe715e

Browse files
committed
VAULT-893 Supervisord
1 parent 3a4bbdd commit abe715e

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,11 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/ratelimit -ldflags="-w -s" -v g
1212

1313
FROM alpine:3.11 AS final
1414
RUN apk --no-cache add ca-certificates
15+
16+
FROM ubuntu:latest as install
17+
RUN apt-get update && apt-get install -y supervisor
18+
RUN mkdir -p /var/log/supervisor
1519
COPY --from=build /go/bin/ratelimit /bin/ratelimit
20+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
21+
22+
ENTRYPOINT ["/usr/bin/supervisord"]

docker-compose.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,6 @@ services:
77
- 6379
88
ports:
99
- "6379:6379"
10-
networks:
11-
- data
12-
volumes:
13-
- redis-data:/data
14-
15-
ratelimit:
16-
build:
17-
context: ./
18-
dockerfile: Dockerfile
19-
ports:
20-
- 8080:8080
21-
depends_on:
22-
- redis
23-
networks:
24-
- data
25-
links:
26-
- redis
27-
volumes:
28-
- ./examples:/data/
29-
- 6379:6379
3010
networks:
3111
- ratelimit-network
3212

@@ -89,8 +69,3 @@ volumes:
8969
ratelimit-data:
9070
- MEMCACHE_HOST_PORT=memcached:11211
9171

92-
networks:
93-
ratelimit-network:
94-
95-
volumes:
96-
binary:

supervisord.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[supervisord]
2+
logfile=/var/log/supervisor/supervisord.log
3+
pidfile=/var/run/supervisord.pid
4+
nodaemon=true
5+
6+
[unix_http_server]
7+
file = /var/tmp/supervisor.sock
8+
9+
[supervisorctl]
10+
serverurl=unix:///var/tmp/supervisor.sock
11+
12+
[program:app]
13+
command=/bin/ratelimit
14+
redirect_stderr=true
15+
stdout_logfile=/dev/stdout ; Just dump to stdout, Docker should find it
16+
stdout_logfile_maxbytes = 0

0 commit comments

Comments
 (0)