Files
scratchbox/Dockerfile
T
s1d3sw1ped ded1bb290b
CI / Go Tests (push) Successful in 12s
CI / Build (push) Successful in 9s
Format / gofmt (push) Successful in 6s
Update Dockerfile to remove unused volume configuration
- Removed the "/config" volume from the Dockerfile, simplifying the container's volume management.
2026-06-01 04:44:17 -05:00

40 lines
920 B
Docker

FROM golang:1.25-alpine AS builder
WORKDIR /src
# Build-time dependencies for UI and Go compilation.
RUN apk add --no-cache nodejs npm
COPY go.mod go.sum ./
RUN go mod download
COPY web/ui/package.json web/ui/package-lock.json ./web/ui/
RUN npm --prefix ./web/ui ci
COPY . .
RUN npm --prefix ./web/ui run build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath -tags "netgo osusergo" -ldflags "-s -w" \
-o /out/scratchbox ./cmd/scratchbox
FROM alpine:3.22
RUN addgroup -S scratchbox && adduser -S -G scratchbox scratchbox
WORKDIR /app
COPY --from=builder /out/scratchbox /usr/local/bin/scratchbox
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
mkdir -p /data /config && chown -R scratchbox:scratchbox /data /config
USER scratchbox
EXPOSE 8080
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]