twitch-bot/Dockerfile
Knut Ahlers 5d0f1acbf2
Add trivy scan, fix trivy errors for Dockerfile
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-06-12 23:35:54 +02:00

50 lines
949 B
Docker

FROM luzifer/archlinux as builder
COPY . /go/src/github.com/Luzifer/twitch-bot
WORKDIR /go/src/github.com/Luzifer/twitch-bot
ENV CGO_ENABLED=0 \
GOPATH=/go
RUN set -ex \
&& pacman -Syy --noconfirm \
curl \
git \
go \
make \
nodejs-lts-gallium \
npm \
&& make frontend \
&& go install \
-trimpath \
-mod=readonly \
-modcacherw \
-ldflags "-X main.version=$(git describe --tags --always || echo dev)"
FROM alpine:latest
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
ENV CONFIG=/data/config.yaml \
STORAGE_CONN_STRING=/data/store.db
RUN set -ex \
&& apk --no-cache add \
bash \
ca-certificates \
curl \
jq \
tzdata \
&& mkdir /data \
&& chown 1000:1000 /data
COPY --from=builder /go/bin/twitch-bot /usr/local/bin/twitch-bot
USER 1000:1000
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/twitch-bot"]
CMD ["--"]
# vim: set ft=Dockerfile: