merge: adopt feature branch changes for APISIX (manifest, Dockerfile, start.sh) and Jenkins (manifest, Dockerfile, start.sh)

This commit is contained in:
2025-09-12 13:48:42 -05:00
parent 26b311b9db
commit d0fae8cbb0
6 changed files with 91 additions and 96 deletions

View File

@@ -1,58 +1,35 @@
FROM cloudron/base:4.2.0 AS build
FROM apache/apisix:3.6.0-debian
ENV DEBIAN_FRONTEND=noninteractive
ENV ENV_INST_LUADIR=/usr/local/apisix
# Switch to root user for package installation and setup
USER root
COPY apisix-source /apisix
# Install additional tools needed for Cloudron
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl wget sudo --no-install-recommends && rm -rf /var/lib/apt/lists/*
WORKDIR /apisix
# Set up directory structure following Cloudron conventions
RUN mkdir -p /app/code /app/data
RUN set -x \
&& apt-get -y update --fix-missing \
&& apt-get install -y \
make \
git \
sudo \
libyaml-dev \
libldap2-dev \
&& make deps \
&& mkdir -p ${ENV_INST_LUADIR} \
&& cp -r deps ${ENV_INST_LUADIR} \
&& make install
FROM cloudron/base:4.2.0
# Install the runtime libyaml package
RUN apt-get -y update --fix-missing \
&& apt-get install -y libyaml-0-2 \
&& apt-get remove --purge --auto-remove -y \
&& mkdir -p /usr/local/apisix/ui
COPY --from=build /usr/local/apisix /usr/local/apisix
COPY --from=build /usr/local/openresty /usr/local/openresty
COPY --from=build /usr/bin/apisix /usr/bin/apisix
# Assuming UI files are in apisix-source/ui, adjust if needed
# Copy APISIX to Cloudron app directory
RUN cp -r /usr/local/apisix/. /app/code/ && \
mkdir -p /app/code/bin && \
cp /usr/bin/apisix /app/code/bin/
# Install brotli (from upstream install-brotli.sh)
RUN apt-get update && apt-get install -y \
libbrotli-dev \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Copy configuration template
COPY config.yaml /app/code/conf/config.yaml
ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin
# Copy start script
COPY start.sh /app/code/start.sh
RUN chmod +x /app/code/start.sh
WORKDIR /usr/local/apisix
# Set proper permissions
RUN groupadd -r cloudron && useradd -r -g cloudron cloudron && chown -R cloudron:cloudron /app/code /app/data
RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \
&& ln -sf /dev/stderr /usr/local/apisix/logs/error.log
# Configure working directory
WORKDIR /app/code
# Expose ports
EXPOSE 9080 9443
# Copy our custom start.sh
COPY start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh
ENTRYPOINT ["/usr/local/bin/start.sh"]
STOPSIGNAL SIGQUIT
# Start the application as cloudron user
CMD ["/usr/bin/sudo", "-E", "-u", "cloudron", "/app/code/start.sh"]