Quickly launch frontend projects like HTML/Vue
349
nginx.conf And mime.types File And Upload dist or index.html Into The Directory-v to Mount The Directory into /appdocker run -it --name container-name --restart always -p 80:80 -v /path/to/directory:/app -d jimkku/app-web
PS: You should tell the root path of index.html(like /app or /app/dist) in the nginx.conf.
I have created a directory named /home/jimkku/example,and then I upload the dist folder and create the nginx.conf and mime.types file in the directory,then I have to tell the root path in the nginx.conf,just like:
http {
include mime.types;
keepalive_timeout 65;
server {
listen 80;
server_name example;
location / {
root /app/dist/;
index index.html index.htm;
}
}
}
OK,the Pre-work has been finished, what I need to do more is run the following cmd:
docker run -it --name example-app --restart always -p 80:80 -v /home/jimkku/example:/app -d jimkku/app-web
Content type
Image
Digest
sha256:2b8d6e1e6…
Size
9.7 MB
Last updated
about 1 year ago
docker pull jimkku/app-web