dockerrrrr

This commit is contained in:
2026-01-10 21:07:35 +01:00
parent 650242261e
commit 47c5ea07a3
+8 -2
View File
@@ -1,16 +1,22 @@
FROM ghcr.io/a-h/templ:latest AS generate-stage FROM ghcr.io/a-h/templ:latest AS generate-stage
COPY . /app COPY --chown=65532:65532 . /app
WORKDIR /app WORKDIR /app
RUN ["templ", "generate"] RUN ["templ", "generate"]
FROM golang:alpine AS build-stage FROM golang:alpine AS build-stage
RUN apk add --no-cache ca-certificates
WORKDIR /app WORKDIR /app
COPY --from=generate-stage /app /app COPY --from=generate-stage /app /app
RUN CGO_ENABLED=0 go build -o iphistory .
RUN CGO_ENABLED=0 go build \
-buildvcs=false \
-ldflags="-s -w" \
-o iphistory .
FROM alpine:latest FROM alpine:latest
RUN apk --no-cache add ca-certificates RUN apk --no-cache add ca-certificates
WORKDIR /app/ WORKDIR /app/
COPY --from=build-stage /app/iphistory . COPY --from=build-stage /app/iphistory .
EXPOSE 8080 EXPOSE 8080
CMD ["./iphistory"] CMD ["./iphistory"]