O
O
oldhowl2018-12-24 23:43:37
.NET
oldhowl, 2018-12-24 23:43:37

.Net Core + React + Docker - how to package correctly?

I am a backend developer. Just started to deal with the docker. Packed .net core application. Works.
Previously, I did the following:
- raised the server
- manually installed the entire environment
- set up nginx
- wrote a small pull and build script for test and for sale
- they gave me the front of the client, I compiled it on the server and deployed it in the same way depending on the type of server (test \ prod)
how to properly wrap this whole thing in docker - I still don’t understand. There are few examples.
Actually the question is:
Do I need to host the front application in .netCore itself through services? (services.AddSpa()). It's inconvenient because I'm not a full stack.
Another option - do I need to make a separate container for the front and prescribe docker-compose? Under this variant I did not find examples.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
akass, 2018-12-25
@akass

2 containers, one nginx with spa and statics, the second one with api core.
compose or not, it already tastes

G
GeneAYak, 2018-12-25
@GeneAYak

Yes, for static it is easier to make one more container. You can use nginx, or you can deploy the server in any language, for example, in go or even in the same .net. By the way, in favor of .net, we can consider the fact that if you pack from the same base image, then in total they will take up a bit more space than one image. Although I would still take nginx) And for proxying to containers, I highly recommend traefik, which itself can track the start and stop of containers, correctly issuing 404 in which case, and there is also a health checker and transparent integration with Lets enctypt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question