A. Docker deployment of springboot project1. Springboot project compilation and packaging2. Create a Dockerfile file in the project root directoryFROM openjdk:8-jdk-alpine VOLUME /tmp ADD ./target/demo-0.0.1-SNAPSHOT.jar demo.jar RUN sh -c 'touch /demo.jar' ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /demo.jar"] demo-0.0.1-SNAPSHOT.jar is changed to your jar package name If the jar package is running in Java, use openjdk:8-jdk-alpine 3. Execute in the root directory to form a docker imagedocker build -t demmo-docker:1.0 . 4. Run the projectdocker run docker run -dp 8080:8080 --name demo-docker demo-docker:1.0 B. Docker deployment of VUE project1. Compile and package the VUE project and execute it in the project root directorynpm run build After execution, there will be a dist folder 2. Copy dist to an empty folder and create a Dockerfile fileFROM nginx MAINTAINER admin COPY dist/ /usr/share/nginx/html/ The dist folder contains html, css and other files. You can use nginx to run html. 3. Execute in the parent folder of Dockerfile to form a docker imagedocker build -t demo-vue-docker . 4. Run the projectdocker run --name car-vue -d -p 8080:80 demo-vue-docker C. Export the imagedocker save -o demo.tar demo-docker:1.0 docker save -o vue-demo.tar demo-vue-docker D. Copy the tar file to the serverCopy the file to the server. The rar file is in the user directory. For example, on a Mac, it will be in /Users/your username/. If you can't find the file, you can use a tool to find it. E. Import the imagedocker load -i demo.tar docker load -i vue-demo.tar F. Run the projectIt is consistent with the above description and will not be repeated here. This is the end of this article about the implementation steps of docker deployment springboot and vue projects. For more relevant docker deployment springboot and vue project content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
>>: Introduction to the use of html base tag target=_parent
Effect picture (if you want a triangle, please cl...
In the horizontal direction, you can set the cell...
This article shares the installation tutorial of ...
Without further ado, here is a demo picture. The ...
Database read-write separation is an essential an...
Nowadays, tabs are widely used in web design, but...
The logs in MySQL include: error log, binary log,...
Table of contents Overview Create a type definiti...
Table of contents Preface 1. 404 Page 1. Causes 2...
1. Error error connecting to master 'x@xxxx:x...
1. Introduction to yum Yum (full name Yellow dogU...
Preface There are many devices nowadays, includin...
1. Create a scheduling task instruction crontab -...
Big data continues to heat up, and if you are not...
Table of contents What is nginx 1. Download the r...