File size: 582 Bytes
5ffe3ab
19a253c
 
 
 
 
 
 
0ef9993
fdf5667
0ef9993
bee122d
 
5ffe3ab
 
bee122d
fdf5667
19a253c
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;"]