From 9cbfe2e336e8c93e61aa472ee24ffac908553e1b Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 12 Sep 2024 22:45:03 +0800 Subject: [PATCH] more --- Dockerfile | 17 ++++++++++++++++- run.sh | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 run.sh 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