Skip to content

feat(docs): update metrics and add logo assets #13

feat(docs): update metrics and add logo assets

feat(docs): update metrics and add logo assets #13

Workflow file for this run

# Dockerfile for Forge CLI

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 5, Col: 1): Unexpected value 'FROM golang:1.22-alpine AS builder'
# Multi-stage build for minimal production image
# Build stage
FROM golang:1.22-alpine AS builder
# Set build arguments
ARG VERSION
ARG COMMIT
ARG BUILD_TIME
# Install build dependencies
RUN apk add --no-cache git ca-certificates tzdata
# Set working directory
WORKDIR /app
# Copy go modules files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download && go mod verify
# Copy source code
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-w -s -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.buildTime=${BUILD_TIME}" \
-a -installsuffix cgo \
-o forge \
./cmd/forge
# Verify the binary
RUN ./forge version
# Production stage
FROM alpine:3.19
# Install runtime dependencies
RUN apk --no-cache add \
ca-certificates \
tzdata \
git \
&& update-ca-certificates
# Create non-root user
RUN addgroup -g 1001 -S forge && \
adduser -u 1001 -S forge -G forge
# Set working directory
WORKDIR /home/forge
# Copy binary from builder
COPY --from=builder /app/forge /usr/local/bin/forge
# Copy timezone data
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
# Copy CA certificates
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Set permissions
RUN chmod +x /usr/local/bin/forge
# Switch to non-root user
USER forge
# Set default environment
ENV PATH="/usr/local/bin:${PATH}"
ENV TZ="UTC"
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD forge version || exit 1
# Default command
ENTRYPOINT ["forge"]
CMD ["--help"]
# Metadata
LABEL org.opencontainers.image.title="Forge CLI" \
org.opencontainers.image.description="Comprehensive backend framework for Go with enterprise-grade features" \
org.opencontainers.image.vendor="Xraph" \
org.opencontainers.image.url="https://github.com/xraph/forge" \
org.opencontainers.image.documentation="https://github.com/xraph/forge/blob/main/README.md" \
org.opencontainers.image.source="https://github.com/xraph/forge" \
org.opencontainers.image.licenses="MIT"