Files
CollabTable/docker/Dockerfile
T
Gabriel20xx bb6a7d0fed
Lint / Lint (push) Failing after 12m15s
Tests / Go backend (push) Failing after 12m24s
Tests / Dashboard checks (push) Failing after 12m27s
Docker / Docker Build & Push (push) Failing after 59s
Retry SharedCode fetches in Docker builds
2026-08-05 20:38:48 +02:00

33 lines
989 B
Docker

FROM node:22-alpine AS frontend-builder
RUN apk add --no-cache git
WORKDIR /frontend
COPY frontend/package*.json ./
RUN for attempt in 1 2 3 4 5; do \
npm ci && break; \
if [ "$attempt" -eq 5 ]; then exit 1; fi; \
delay=$((attempt * 5)); \
echo "SharedCode npm install failed (attempt ${attempt}/5); retrying in ${delay}s..." >&2; \
sleep "$delay"; \
done
COPY frontend/ ./
RUN npm run build
FROM golang:1.26-alpine AS builder
WORKDIR /app
COPY backend/go.mod backend/go.sum ./
COPY SharedCode/backend/ /SharedCode/backend/
RUN go mod download
COPY backend/*.go ./
COPY --from=frontend-builder /frontend/build ./web
RUN apk add --no-cache ca-certificates && \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o server .
FROM scratch
COPY --from=builder /app/server /server
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
USER 65534:65534
EXPOSE 3000
VOLUME ["/data"]
ENV PORT=3000
ENTRYPOINT ["/server"]