使用 react 容器
docker run -d -p 20080:80 --name nginxCoCoTF registry.cn-hangzhou.aliyuncs.com/mkmk/nginx:ReactCocoTF
js bootstarp 容器
docker run -d -p 30080:80 --name nginxtfjsssd registry.cn-hangzhou.aliyuncs.com/mkmk/nginx:tfjsssd
nginx config
docker run -d -p 10080:80 --name nginx1 nginx
docker exec -it nginx1 /bin/bash
find / -name “nginx.conf”
/etc/nginx/nginx.conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html/build;
index index.html index.htm;
}
}
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
copy build
docker cp build/ nginx1:/usr/share/nginx/html/build
替换
sed -i ‘s?/usr/share/nginx/html?/usr/share/nginx/html/build?g’ /etc/nginx/nginx.conf
cat < /etc/nginx/nginx.conf
成品镜像
registry.cn-hangzhou.aliyuncs.com/mkmk/nginx:ReactCocoTF
docker run -d -p 20080:80 --name nginxCoCoTF registry.cn-hangzhou.aliyuncs.com/mkmk/nginx:ReactCocoTF
压缩 派出文件
zip -r 压缩目录.zip 源目录/ -x 排出的目录 -x “cloud_backweb/download/wordfile/*”