# Local Docker Registry for Bakery-IA
# Simple registry to cache base images and reduce Docker Hub usage

FROM registry:2

# Configure registry for local development
ENV REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/var/lib/registry
ENV REGISTRY_HTTP_SECRET=development-secret
ENV REGISTRY_HTTP_ADDR=0.0.0.0:5000

# Create directory for registry data
RUN mkdir -p /var/lib/registry

# Expose registry port
EXPOSE 5000

# Health check
HEALTHCHECK --interval=30s --timeout=3s \
    CMD wget -q --spider http://localhost:5000/v2/ || exit 1

# Run registry
CMD ["registry", "serve", "/etc/docker/registry/config.yml"]