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
Table of contents 1. Preprocessing 2. Pretreatmen...
1. Overview The information_schema database is th...
URL: http://hostname.com/contextPath/servletPath/...
Table of contents 1. What is lazy loading? 2. Imp...
Table of contents 1. Commonjs exports and require...
Copy code The code is as follows: window.location...
1. Convert the json object into a json string, an...
Hyperlink Hyperlinks are the most frequently used ...
difficulty Two mask creation of svg graphics Firs...
Detailed analysis of SQL execution steps Let'...
Slow query log related parameters MySQL slow quer...
Vue version, copy it to the file and use it <t...
1. Usage: (1) EXISTS usage select a.batchName,a.p...
There are three ways to start a springboot projec...
How to obtain SQL statements with performance iss...