FROM apache/apisix:3.8.0-debian # Metadata labels LABEL org.opencontainers.image.title="Apache APISIX" LABEL org.opencontainers.image.description="Cloudron package for Apache APISIX API Gateway" LABEL org.opencontainers.image.source="https://github.com/apache/apisix" # Switch to root to modify the image USER root # Install additional dependencies if needed RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # Create cloudron user RUN useradd -r -s /bin/bash -d /app -m cloudron # Create APISIX data directories RUN mkdir -p /app/data/apisix && \ mkdir -p /app/data/apisix/logs && \ mkdir -p /app/data/apisix/conf && \ chown -R cloudron:cloudron /app/data # Copy startup script COPY start.sh /app/pkg/start.sh RUN chmod +x /app/pkg/start.sh && chown cloudron:cloudron /app/pkg/start.sh # Switch to cloudron user USER cloudron # Expose APISIX ports EXPOSE 9180 9080 # APISIX environment variables ENV APISIX_HOME=/app/data/apisix \ APISIX_WORKDIR=/app/data/apisix \ APP_PORT=9180 HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD curl -fsS http://127.0.0.1:${APP_PORT}/apisix/admin/routes || exit 1 CMD ["/app/pkg/start.sh"]