File size: 579 Bytes
7ee901b 04edd84 7ee901b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | FROM golang:alpine AS builder
RUN apk add --no-cache git
ENV GOTOOLCHAIN=auto
WORKDIR /app
RUN --mount=type=secret,id=GH_REPO,required=true \
git clone $(cat /run/secrets/GH_REPO) .
RUN go mod tidy
RUN go build -o solver ./main.go
FROM alpine:latest
WORKDIR /app
RUN apk add --no-cache \
chromium \
xvfb \
bash \
ca-certificates \
ttf-freefont \
udev
COPY --from=builder /app/solver .
ENV DEBUG=1 \
PORT=7860 \
XVFB_DISPLAY_BASE=99 \
ALLOW_NO_SANDBOX=true \
CHROME_PATH=/usr/bin/chromium-browser
EXPOSE 7860
CMD ["./solver"] |