提交dockerfile

This commit is contained in:
2026-03-23 09:44:54 +08:00
commit 834242bb7e
11 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
ARG NGINX_VERSION=1.28.2
#FROM registry.openanolis.cn/openanolis/anolisos:8.6
FROM registry.openanolis.cn/openanolis/anolisos:8.10
ARG NGINX_VERSION
ADD nginx-${NGINX_VERSION}.tar.gz /usr/local/
RUN yum -y install gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel make libnghttp2 && \
useradd -M nginx && \
cd /usr/local/nginx-${NGINX_VERSION}/ && \
./configure --with-http_ssl_module --with-http_secure_link_module && make && make install && \
mkdir -pv /usr/local/nginx/conf/conf.d && \
mkdir -pv /storage/nginx_logs/ && chown -R nginx:nginx /storage/nginx_logs && \
echo "ok" > /usr/local/nginx/html/index.html && \
rm -rf /usr/local/nginx-${NGINX_VERSION}
COPY nginx.conf /usr/local/nginx/conf/
COPY localhost.conf /usr/local/nginx/conf/conf.d/
COPY 404.html 50x.html /usr/local/nginx/html
EXPOSE 80 443
CMD ["/usr/local/nginx/sbin/nginx","-g","daemon off;"]