mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-06-08 08:12:35 +00:00
53 lines
1.6 KiB
Docker
53 lines
1.6 KiB
Docker
# Build stage
|
|
FROM golang:1.24-alpine AS builder
|
|
|
|
# Install build dependencies (gcc and musl-dev needed for SQLite CGO)
|
|
RUN apk add --no-cache git make gcc musl-dev sqlite-dev
|
|
|
|
# Set working directory
|
|
WORKDIR /build
|
|
|
|
# Copy go mod files
|
|
COPY go.mod go.sum ./
|
|
|
|
# Download dependencies
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the binary with CGO enabled for SQLite support
|
|
RUN CGO_ENABLED=1 GOOS=linux go build -a -o atcr-appview ./cmd/appview
|
|
|
|
# Runtime stage
|
|
FROM alpine:latest
|
|
|
|
# Install CA certificates for HTTPS, SQLite runtime libraries, and sqlite CLI for debugging
|
|
RUN apk --no-cache add ca-certificates sqlite-libs sqlite
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy binary from builder
|
|
COPY --from=builder /build/atcr-appview .
|
|
|
|
# Create directories for storage
|
|
RUN mkdir -p /var/lib/atcr/blobs /var/lib/atcr/auth
|
|
|
|
# Expose ports
|
|
EXPOSE 5000 5001
|
|
|
|
# OCI image annotations
|
|
LABEL org.opencontainers.image.title="ATCR AppView" \
|
|
org.opencontainers.image.description="ATProto Container Registry - OCI-compliant registry using AT Protocol for manifest storage" \
|
|
org.opencontainers.image.authors="ATCR Contributors" \
|
|
org.opencontainers.image.source="https://tangled.org/@evan.jarrett.net/at-container-registry" \
|
|
org.opencontainers.image.documentation="https://tangled.org/@evan.jarrett.net/at-container-registry" \
|
|
org.opencontainers.image.licenses="MIT" \
|
|
org.opencontainers.image.version="0.1.0" \
|
|
io.atcr.icon="https://imgs.blue/evan.jarrett.net/1TpTNrRelfloN2emuWZDrWmPT0o93bAjEnozjD6UPgoVV9m4"
|
|
|
|
# Run the AppView (no config file - uses environment variables)
|
|
ENTRYPOINT ["/app/atcr-appview"]
|
|
CMD ["serve"]
|