kycnot.me/src/Dockerfile

33 lines
851 B
Docker
Raw Normal View History

2024-02-18 11:17:22 -05:00
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
2024-02-18 17:37:33 -05:00
2024-02-18 11:17:22 -05:00
WORKDIR /app
COPY ./package.json .
COPY ./package-lock.json .
COPY ./tailwind.config.js .
COPY ./frontend/ /app/
2024-02-18 17:37:33 -05:00
2024-02-18 11:17:22 -05:00
RUN npm i && \
2024-02-18 17:37:33 -05:00
npx tailwindcss -i /app/static/css/input.css -o /app/style.css --minify
2024-02-18 11:17:22 -05:00
FROM alpine:latest as certs
RUN apk --update add ca-certificates
2024-02-19 03:32:44 -05:00
FROM scratch
2024-02-18 11:17:22 -05:00
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
2024-02-18 17:37:33 -05:00
COPY ./frontend /app/frontend
COPY --from=tailwind /app/style.css /app/frontend/static/css/style.css
2024-02-18 11:17:22 -05:00
COPY --from=builder /app/kycnotme /bin/usr/kycnotme
ENV PATH="/bin/usr:${PATH}"
EXPOSE 4488
ENTRYPOINT ["kycnotme", "-scrap"]