CreepURL / Dockerfile
dipan004's picture
Update Dockerfile
8f958a9 verified
Raw
History Blame Contribute Delete
718 Bytes
FROM golang:1.21-alpine AS builder
WORKDIR /src
COPY backend/go.mod backend/go.sum ./backend/
WORKDIR /src/backend
RUN go mod download
COPY backend/ ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /out/creepurl main.go
FROM alpine:3.20
WORKDIR /app
RUN adduser -D -u 10001 appuser && chown appuser:appuser /app
COPY --from=builder --chown=appuser:appuser /out/creepurl ./creepurl
# Port HuggingFace requires
EXPOSE 7860
USER appuser
# NO ENV lines here — all vars must be set in HF Space Settings
# Required vars to set in HF Space Settings:
# PORT=7860
# DB_PATH=./creepurl.db
# BASE_URL=https://www.creepurl-xr77stvr.2bd.net
# ENVIRONMENT=production
CMD ["./creepurl"]