Add Gitea CI/CD workflows and Dockerfile (#1)
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:
2026-09-06 22:23:12 +00:00
committed by aneurin
parent 3bfb73d3b9
commit 1dfa60a237
5 changed files with 166 additions and 0 deletions
+19
View File
@@ -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"]