Package or bust!
This commit is contained in:
@@ -1,44 +1,38 @@
|
||||
FROM apache/apisix:3.8.0-debian
|
||||
FROM cloudron/base:5.0.0
|
||||
|
||||
# Metadata labels
|
||||
# Metadata labels (edit as needed)
|
||||
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"
|
||||
LABEL org.opencontainers.image.description="Cloudron package for Apache APISIX"
|
||||
LABEL org.opencontainers.image.source="https://example.com"
|
||||
|
||||
# Switch to root to modify the image
|
||||
USER root
|
||||
# Install OS dependencies here as needed
|
||||
# RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# curl ca-certificates tini \
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 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/*
|
||||
# App code lives in /app/code (read-only at runtime)
|
||||
WORKDIR /app/code
|
||||
|
||||
# Create cloudron user
|
||||
RUN useradd -r -s /bin/bash -d /app -m cloudron
|
||||
# Copy application code (adjust as needed)
|
||||
# COPY . /app/code
|
||||
|
||||
# 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
|
||||
# Create persistent directory for application data
|
||||
RUN mkdir -p /app/data && 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
|
||||
# Expose the app port specified in manifest
|
||||
EXPOSE 9180
|
||||
|
||||
# APISIX environment variables
|
||||
ENV APISIX_HOME=/app/data/apisix \
|
||||
APISIX_WORKDIR=/app/data/apisix \
|
||||
# Default environment (customize per app)
|
||||
ENV NODE_ENV=production \
|
||||
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
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||
CMD curl -fsS http://127.0.0.1:${APP_PORT}/ || exit 1
|
||||
|
||||
CMD ["/app/pkg/start.sh"]
|
||||
|
Reference in New Issue
Block a user