mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-06-07 07:42:35 +00:00
59 lines
1.8 KiB
Docker
59 lines
1.8 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 .
|
|
|
|
# Copy default configuration
|
|
COPY config/config.yml /etc/atcr/config.yml
|
|
|
|
# Create directories for storage
|
|
RUN mkdir -p /var/lib/atcr/blobs /var/lib/atcr/auth
|
|
|
|
# Expose ports
|
|
EXPOSE 5000 5001
|
|
|
|
# Set environment variables
|
|
ENV ATCR_CONFIG=/etc/atcr/config.yml
|
|
|
|
# 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
|
|
ENTRYPOINT ["/app/atcr-appview"]
|
|
CMD ["serve", "/etc/atcr/config.yml"]
|