1. create dockerfile
    1). config frontend project build
    image.png
    2). config nginx
    image.png
  2. create nginx/default.conf
  3. build docker
    sudo docker build -t imageName
  4. run docker
    docker run --rm -d -p80:80 imageName
  5. find docker host and port
    ifconfig
  6. type docker host + post + frontendRoutePath in browser address bar, such as: http://localhost/login
  7. login docker
    docker login
  8. tag docker image
    docker tag imageName:version userName/imageName:version
  9. push image to remote docker hub
    docker push dockerUserName/imageName:version

abby_mrs
510 声望12 粉丝