2021-12-06 16:25:19 +00:00
|
|
|
FROM luzifer/archlinux as builder
|
2020-12-21 00:54:14 +00:00
|
|
|
|
|
|
|
COPY . /go/src/github.com/Luzifer/twitch-bot
|
|
|
|
WORKDIR /go/src/github.com/Luzifer/twitch-bot
|
|
|
|
|
2021-12-06 16:25:19 +00:00
|
|
|
ENV CGO_ENABLED=0 \
|
2023-06-12 21:35:54 +00:00
|
|
|
GOPATH=/go
|
2021-08-19 15:18:37 +00:00
|
|
|
|
2020-12-21 00:54:14 +00:00
|
|
|
RUN set -ex \
|
2021-12-06 16:25:19 +00:00
|
|
|
&& pacman -Syy --noconfirm \
|
2021-09-22 13:36:45 +00:00
|
|
|
curl \
|
|
|
|
git \
|
2021-12-06 16:25:19 +00:00
|
|
|
go \
|
2021-09-22 13:36:45 +00:00
|
|
|
make \
|
2023-07-04 18:50:51 +00:00
|
|
|
nodejs-lts-hydrogen \
|
2021-12-06 16:25:19 +00:00
|
|
|
npm \
|
2023-07-14 14:27:29 +00:00
|
|
|
&& make node_modules frontend_prod \
|
2020-12-21 00:54:14 +00:00
|
|
|
&& go install \
|
2022-02-26 13:59:02 +00:00
|
|
|
-trimpath \
|
|
|
|
-mod=readonly \
|
|
|
|
-modcacherw \
|
|
|
|
-ldflags "-X main.version=$(git describe --tags --always || echo dev)"
|
2020-12-21 00:54:14 +00:00
|
|
|
|
2021-12-06 16:25:19 +00:00
|
|
|
|
2020-12-21 00:54:14 +00:00
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
|
|
|
|
|
|
|
ENV CONFIG=/data/config.yaml \
|
2023-06-12 21:35:54 +00:00
|
|
|
STORAGE_CONN_STRING=/data/store.db
|
2020-12-21 00:54:14 +00:00
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
&& apk --no-cache add \
|
2021-01-10 22:11:59 +00:00
|
|
|
bash \
|
2021-01-10 21:30:16 +00:00
|
|
|
ca-certificates \
|
|
|
|
curl \
|
2021-05-06 13:14:58 +00:00
|
|
|
jq \
|
2023-06-12 21:35:54 +00:00
|
|
|
tzdata \
|
|
|
|
&& mkdir /data \
|
|
|
|
&& chown 1000:1000 /data
|
2020-12-21 00:54:14 +00:00
|
|
|
|
|
|
|
COPY --from=builder /go/bin/twitch-bot /usr/local/bin/twitch-bot
|
|
|
|
|
2023-06-12 21:35:54 +00:00
|
|
|
USER 1000:1000
|
2020-12-21 00:54:14 +00:00
|
|
|
VOLUME ["/data"]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/twitch-bot"]
|
|
|
|
CMD ["--"]
|
|
|
|
|
|
|
|
# vim: set ft=Dockerfile:
|