Docker from development to deployment
Daniel da Rocha
Posted on January 3, 2019
Hi!
I've been trying to solve this for days now so I might finally just ask for help:
In my development docker-compose configuration, I have 4 containers:
-
front: Vue app started using
npm run serve
on port 80 - back: Koa2 server for my API (Postgraphile for GraphQL)
- database: Postgres container
-
front-balancer: Nginx server, sends
/
to front,/graphql
to back
It works fine locally (although I probably should skip Nginx for development...)
Now I want to deploy it, and that's where my headaches began. My initial understanding is that I should not use npm run serve
for front on production, but instead build my Vue app and serve the static files with Nginx.
But does that mean I do not need my front container in production and can just mount the built files to my Nginx container?
Or how would you approach this?
Then comes the actual deployment. I am still at a loss as to where (DO, Heroku, AWS??) and how to deploy it (CD workflow). But that might come as a later question once I figure out the step above!
Thanks in advance!
Posted on January 3, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.