A
A
Anrek2022-04-21 15:35:18
System administration
Anrek, 2022-04-21 15:35:18

Have I chosen the right technologies for a simple web server?

Hello!

There is a task: to deploy simple front, back and database on the VM. At the same time:
- the database must have a public ip
- the front and back should be set up for auto-deploy (so that the master branch flows into the prod)
- so that the back and front are in containers and that the back can be accessed via url via Postman.

Now I see the sequence of work, I see it like this:
- I just put the database in a separate ready-made cluster, which the hosting owner represents for the databases), it has both a private and a public ip
- I rent a vm, put it in 1 subnet with a database cluster, install docker, docker compose and nginx in the vm, wrap the front and back in docker containers, push the containers to the docker hub. Then on the server I write a yaml file for docker compose (services: nginx, front and back), I take containers from the link from the docker hub, and launch it.

Questions:
1) Do I see the sequence correctly and do I need something else besides nginx and docker?
2) How is the backing url formed if I want to access it from outside? (if important, selectel hosting)
3) What can be used to organize auto-deploy in this case (here the containers are deployed)? I understand how, for example, to connect Google App Engine and bitbucket, in fact you write a pipeline, in bitbucket you set up a deployment in the settings with a link which service to update and you're done. How about here? we always first create a container at home, then we push it, and it is already deployed to the server automatically, or is there another logic here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krax1337, 2022-04-25
@Anrek

Hey!
1) That's right, a domain with https. And then in nginx it will be / -> front , /api -> back . For example like this.
2) Proper nginx configuration and reverse proxy on the backing container.
3) You can use free CI, for example Gitlab CI/CD or Github Actions. Push image to private registry. Then the script goes to the server and changes the docker image. The server with Docker, respectively, must have access to this private registry. You can look at this example https://stackoverflow.com/questions/26423515/how-t... . Or you can dig into solutions like Flux or ArgoCD. But k8s will probably already be overhead.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question