diff --git a/Dockerfile b/Dockerfile index 143ad1f..99bef77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,18 @@ FROM php:8.2.16-cli-alpine3.19 -CMD ["php", "-f", "/var/www/html/start.php"] \ No newline at end of file +LABEL org.opencontainers.image.authors="anfu" + +RUN apk add --no-cache nginx + +VOLUME /var/www/html + +ENV NACOS_ADDR="192.168.1.105:8848" \ + SERVER_ADDR="192.168.1.161:80" + +COPY . /var/www/html + +WORKDIR /var/www/html + +EXPOSE 80 + +ENTRYPOINT ["/run.sh"] diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..52ba875 --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# 后台启动 +php-fpm -D +# 关闭后台启动,hold住进程 +nginx -g 'daemon off;' \ No newline at end of file