Add Gitea CI/CD workflows and Dockerfile (#1)
Build / build-and-push (push) Successful in 1m34s
Build / build-and-push (push) Successful in 1m34s
Co-authored-by: Aneurin Barker Snook <aneurin@aneur.in>
This commit was merged in pull request #1.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
# Build stage: compile a static binary so the runtime image can be minimal.
|
||||
FROM golang:1.25-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /ultrashorty .
|
||||
|
||||
# Runtime stage.
|
||||
FROM alpine:3.20
|
||||
RUN adduser -D -u 10001 ultrashorty
|
||||
USER ultrashorty
|
||||
COPY --from=build /ultrashorty /usr/local/bin/ultrashorty
|
||||
# The redirects CSV is supplied at deploy time (bind mount / config), and
|
||||
# --host must be set to 0.0.0.0 to accept connections from outside the
|
||||
# container -- ultrashorty defaults to localhost. Example:
|
||||
# docker run -v ./redirects.csv:/redirects.csv <image> --host 0.0.0.0 /redirects.csv
|
||||
EXPOSE 4000
|
||||
ENTRYPOINT ["ultrashorty"]
|
||||
Reference in New Issue
Block a user