# Custom Zot image with additional tools
FROM ghcr.io/project-zot/zot:v2.0.1

# Install additional tools for management
RUN apk add --no-cache \
    curl \
    jq \
    bash \
    openssl \
    ca-certificates

# Add health check script
COPY healthcheck.sh /usr/local/bin/healthcheck.sh
RUN chmod +x /usr/local/bin/healthcheck.sh

# Create required directories
RUN mkdir -p /var/lib/registry /var/log/zot /etc/zot/certs

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
  CMD /usr/local/bin/healthcheck.sh

EXPOSE 5000

ENTRYPOINT ["/usr/bin/zot"]
CMD ["serve", "/etc/zot/config.json"]
