bouncer/Dockerfile

36 lines
1001 B
Docker
Raw Normal View History

2023-06-30 04:13:56 +02:00
FROM golang:1.20 AS BUILD
2023-04-24 20:52:12 +02:00
RUN apt-get update \
&& apt-get install -y make
COPY . /src
WORKDIR /src
RUN make GORELEASER_ARGS='build --rm-dist --single-target --snapshot' goreleaser
FROM busybox:latest AS RUNTIME
ARG DUMB_INIT_VERSION=1.2.5
RUN mkdir -p /usr/local/bin \
&& wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_x86_64 \
&& chmod +x /usr/local/bin/dumb-init
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
2023-06-30 04:13:56 +02:00
RUN mkdir -p /usr/local/bin /usr/share/bouncer/bin /etc/bouncer
COPY --from=BUILD /src/dist/bouncer_linux_amd64_v1/bouncer /usr/share/bouncer/bin/bouncer
COPY --from=BUILD /src/layers /usr/share/bouncer/
2023-06-30 04:13:56 +02:00
RUN ln -s /usr/share/bouncer/bin/bouncer /usr/local/bin/bouncer \
&& /usr/share/bouncer/bin/bouncer -c '' config dump > /etc/bouncer/config.yml
2023-04-24 20:52:12 +02:00
EXPOSE 8080
EXPOSE 8081
2023-06-30 04:13:56 +02:00
ENV BOUNCER_WORKDIR=/usr/share/bouncer
ENV BOUNCER_CONFIG=/etc/bouncer/config.yml
2023-04-24 20:52:12 +02:00
2023-06-30 04:13:56 +02:00
CMD ["bouncer"]