If you did the last post on success https://springboot-vuejs-reactjs.blogspot.com/2019/12/how-to-deploy-distzip-vuejs-project-on.html doing it using docker-compose using volumes is much easier so that if you are going to make changes on the nginx.conf, or if you're going to add new SSL certificates or if you're going to update the VueJS app, then you are not going to need to rebuild the image and run it again, the only thing is just changing the files on the host you need and restart the .yml file and that's it you're done.
if you don't have docker-compose installed on Centos 7, just run
yum update && yum install docker-compose
let's create a folder where you are going to have your files, in my case I did something like
|---/Data/nginx
|-------------ssl
|-------------conf
|-------------html
inside ssl there are ( cert-chain.crt and server.key )
inside conf there is ( nginx.conf )
inside html there is the dist folder which has got the app ( dist )
and inside that folder let's create a file nginx.yml or whatever name you want to give it
and inside that file lest write this
now to run it, just do docker-compose -f nginx.yml up
-f means that a .yml file with a different name than docker-compose.yml is being used in this case the .yml file was called nginx.yml
and what up does is create and start the container, now to run in detached mode or background mode just run docker-compose -f nginx.yml up -d
now if you run docker container ls
If you need now to get to the shell, run this
docker exec -it --user root nginx-deployer bash
you can stop the container in 2 ways:
with the .yml file docker-compose -f nginx.yml stop / docker-compose -f nginx.yml restart
with the docker name container docker container stop nginx-deployer / docker container restart nginx-deployer
if you don't have docker-compose installed on Centos 7, just run
yum update && yum install docker-compose
let's create a folder where you are going to have your files, in my case I did something like
|---/Data/nginx
|-------------ssl
|-------------conf
|-------------html
inside ssl there are ( cert-chain.crt and server.key )
inside conf there is ( nginx.conf )
inside html there is the dist folder which has got the app ( dist )
and inside that folder let's create a file nginx.yml or whatever name you want to give it
and inside that file lest write this
now to run it, just do docker-compose -f nginx.yml up
-f means that a .yml file with a different name than docker-compose.yml is being used in this case the .yml file was called nginx.yml
and what up does is create and start the container, now to run in detached mode or background mode just run docker-compose -f nginx.yml up -d
now if you run docker container ls
If you need now to get to the shell, run this
docker exec -it --user root nginx-deployer bash
you can stop the container in 2 ways:
with the .yml file docker-compose -f nginx.yml stop / docker-compose -f nginx.yml restart
with the docker name container docker container stop nginx-deployer / docker container restart nginx-deployer
Comments
Post a Comment