kycnot.me/src/Dockerfile
2024-02-19 09:32:44 +01:00

33 lines
851 B
Docker

FROM devopsworks/golang-upx:latest as builder
WORKDIR /app
COPY . .
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o kycnotme . && \
upx kycnotme
RUN chmod +x kycnotme
# Tailwind CSS compiler
FROM node:latest as tailwind
WORKDIR /app
COPY ./package.json .
COPY ./package-lock.json .
COPY ./tailwind.config.js .
COPY ./frontend/ /app/
RUN npm i && \
npx tailwindcss -i /app/static/css/input.css -o /app/style.css --minify
FROM alpine:latest as certs
RUN apk --update add ca-certificates
FROM scratch
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
COPY ./frontend /app/frontend
COPY --from=tailwind /app/style.css /app/frontend/static/css/style.css
COPY --from=builder /app/kycnotme /bin/usr/kycnotme
ENV PATH="/bin/usr:${PATH}"
EXPOSE 4488
ENTRYPOINT ["kycnotme", "-scrap"]