dist2 / Dockerfile
zhuyougu's picture
Update Dockerfile
5ffe3ab
FROM nginx:alpine
# 将本地的nginx.conf复制到镜像中的/etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/nginx.conf
# 将本地的html文件复制到镜像中的/usr/share/nginx/html
COPY dist2 /usr/share/nginx/html
# 在Dockerfile中添加
RUN chmod -R 777 /var/cache/nginx
RUN chmod -R 777 /var/run /etc/nginx/conf.d
# 添加字体支持,这里使用的是 Alpine Linux 的 apk 命令
RUN apk --no-cache add ttf-dejavu fontconfig
# 暴露7860端口,使外部可以访问Nginx
EXPOSE 7860
# 定义容器启动时执行的命令
CMD ["nginx", "-g", "daemon off;"]