mirror of
https://codeberg.org/pluja/kycnot.me
synced 2024-10-01 01:05:59 -04:00
add dockerfile
This commit is contained in:
parent
f672feaea1
commit
b8ecef5a6e
1
src/.dockerignore
Normal file
1
src/.dockerignore
Normal file
@ -0,0 +1 @@
|
||||
.env
|
31
src/Dockerfile
Normal file
31
src/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
||||
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 ./static/css/input.css -o ./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/style.css
|
||||
COPY --from=builder /app/kycnotme /bin/usr/kycnotme
|
||||
ENV PATH="/bin/usr:${PATH}"
|
||||
|
||||
EXPOSE 4488
|
||||
ENTRYPOINT ["kycnotme", "-scrap"]
|
Loading…
Reference in New Issue
Block a user