|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | +FROM debian:bullseye-slim AS build |
| 18 | + |
| 19 | +ARG ENABLE_PROXY=false |
| 20 | +ARG CODE_PATH |
| 21 | + |
| 22 | +ENV DEBIAN_FRONTEND=noninteractive |
| 23 | +ENV ENV_INST_LUADIR=/usr/local/apisix |
| 24 | + |
| 25 | +COPY ${CODE_PATH} /apisix |
| 26 | + |
| 27 | +WORKDIR /apisix |
| 28 | + |
| 29 | +RUN set -x \ |
| 30 | + && apt-get -y update --fix-missing \ |
| 31 | + && apt-get install -y \ |
| 32 | + make \ |
| 33 | + git \ |
| 34 | + sudo \ |
| 35 | + libyaml-dev \ |
| 36 | + && ls -al \ |
| 37 | + && make deps \ |
| 38 | + && mkdir -p ${ENV_INST_LUADIR} \ |
| 39 | + && cp -r deps ${ENV_INST_LUADIR} \ |
| 40 | + && make install |
| 41 | + |
| 42 | +FROM debian:bullseye-slim |
| 43 | + |
| 44 | +ARG ENTRYPOINT_PATH=./docker-entrypoint.sh |
| 45 | +ARG INSTALL_BROTLI=./install-brotli.sh |
| 46 | +ARG CHECK_STANDALONE_CONFIG=./check_standalone_config.sh |
| 47 | + |
| 48 | +COPY --from=build /usr/local/apisix /usr/local/apisix |
| 49 | +COPY --from=build /usr/local/openresty /usr/local/openresty |
| 50 | +COPY --from=build /usr/bin/apisix /usr/bin/apisix |
| 51 | +COPY --from=build /usr/lib/x86_64-linux-gnu/libyaml* /usr/local/lib/ |
| 52 | + |
| 53 | +COPY ${INSTALL_BROTLI} /install-brotli.sh |
| 54 | +RUN chmod +x /install-brotli.sh \ |
| 55 | + && cd / && ./install-brotli.sh && rm -rf /install-brotli.sh |
| 56 | + |
| 57 | +ENV PATH=$PATH:/usr/local/openresty/luajit/bin:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin |
| 58 | + |
| 59 | +WORKDIR /usr/local/apisix |
| 60 | + |
| 61 | +RUN ln -sf /dev/stdout /usr/local/apisix/logs/access.log \ |
| 62 | + && ln -sf /dev/stderr /usr/local/apisix/logs/error.log |
| 63 | + |
| 64 | +EXPOSE 9080 9443 |
| 65 | + |
| 66 | +COPY ${ENTRYPOINT_PATH} /docker-entrypoint.sh |
| 67 | +COPY ${CHECK_STANDALONE_CONFIG} /check_standalone_config.sh |
| 68 | +RUN chmod +x /docker-entrypoint.sh /check_standalone_config.sh |
| 69 | + |
| 70 | +ENTRYPOINT ["/docker-entrypoint.sh"] |
| 71 | + |
| 72 | +CMD ["docker-start"] |
| 73 | + |
| 74 | +STOPSIGNAL SIGQUIT |
0 commit comments