diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81f3cc0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM nginx:1.17.9-alpine + +LABEL maintainer="clibing " + +ARG TZ='Asia/Shanghai' + +ENV TZ ${TZ} + +RUN apk upgrade --update \ + && apk add bash \ + && ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \ + && echo ${TZ} > /etc/timezone \ + && rm -rf /usr/share/nginx/html /var/cache/apk/* + +COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf + +COPY dist /usr/share/nginx/html + +RUN chown -R nginx /usr/share/nginx/html + +EXPOSE 80 + +STOPSIGNAL SIGTERM + +CMD ["nginx", "-g", "daemon off;"] + diff --git a/nginx.vh.default.conf b/nginx.vh.default.conf new file mode 100644 index 0000000..f382f4c --- /dev/null +++ b/nginx.vh.default.conf @@ -0,0 +1,20 @@ +server { + listen 80; + server_name localhost; + + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + + root /usr/share/nginx/html; + index index.html index.htm; + + location / { + try_files $uri $uri/index.html $uri/index.htm /index.html; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +}