Answer the question
In order to leave comments, you need to log in
What are the tools to automate the deployment of applications with Docker and Nginx?
I have a VPS, I installed nginx there. Often you have to raise small web applications and all sorts of bots, these applications are test ones, they are not used commercially anywhere, they don’t have a special load, this server is just for demos. And since their number is growing, I'm thinking about automating the process.
When I want to deploy a bot, for example, my process is like this.
1. Built the image -> pushed it into the registry. For example, in docker.io
2. I launch the image on the server with the necessary environment variables on a specific port
docker run --name=jokebot -d -e VK_ACCESS_TOKEN=<token> -p <deploy_port>:80 delgus/jokebot
server {
listen 80;
listen 443 ssl http2;
server_name sub.domain.com;
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain.com/chain.pem;
ssl_stapling on;
ssl_stapling_verify on;
resolver 127.0.0.1 8.8.8.8;
location / {
proxy_pass http://127.0.0.1:5000;
}
location /.well-known {
root /var/www/letsencrypt;
}
}
Answer the question
In order to leave comments, you need to log in
You need nginx-proxy , here's one of the coolest ones. https://hub.docker.com/r/jwilder/nginx-proxy/dockerfile
You just specify VIRTUAL_HOST and VIRTUAL_PORT when starting the container and it itself registers where it is needed and just starts to be proxied to the running container.
1. Built the image -> pushed it into the registry. For example, in docker.ioThe usual deployment process from the CI / CD area. You can immediately send the finished image to the target server and run it there as you please. Someone writes a little Ansible policy that does everything.
2. I run the image on the server with the necessary environment variables on a specific port
3. ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question