Skip to content

Commit

Permalink
VAULT-893 Supervisord
Browse files Browse the repository at this point in the history
  • Loading branch information
Iapetus999 authored and zdmytriv committed Jul 23, 2021
1 parent 44ab3f5 commit 597f22f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o /go/bin/ratelimit -ldflags="-w -s" -v g

FROM alpine:3.11 AS final
RUN apk --no-cache add ca-certificates

FROM ubuntu:latest as install
RUN apt-get update && apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
COPY --from=build /go/bin/ratelimit /bin/ratelimit
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

ENTRYPOINT ["/usr/bin/supervisord"]
25 changes: 0 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,6 @@ services:
- 6379
ports:
- "6379:6379"
networks:
- data
volumes:
- redis-data:/data

ratelimit:
build:
context: ./
dockerfile: Dockerfile
ports:
- 8080:8080
depends_on:
- redis
networks:
- data
links:
- redis
volumes:
- ./examples:/data/
- 6379:6379
networks:
- ratelimit-network

Expand Down Expand Up @@ -89,8 +69,3 @@ volumes:
ratelimit-data:
- MEMCACHE_HOST_PORT=memcached:11211

networks:
ratelimit-network:

volumes:
binary:
16 changes: 16 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[supervisord]
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
nodaemon=true

[unix_http_server]
file = /var/tmp/supervisor.sock

[supervisorctl]
serverurl=unix:///var/tmp/supervisor.sock

[program:app]
command=/bin/ratelimit
redirect_stderr=true
stdout_logfile=/dev/stdout ; Just dump to stdout, Docker should find it
stdout_logfile_maxbytes = 0

0 comments on commit 597f22f

Please sign in to comment.