Introduction
Hello fellow developers!
With this guide, we will be creating a project that includes React or Vue as the front-end framew...
For further actions, you may consider blocking this person and/or reporting abuse
Great tutorial!
Seeing the "Makerfile" bonus, i noticed it was not oriented for windows users.
Anyway, I executed the steps and this just worked fine, except for the sweet hot reload effect. After some research, i found the solution. Just add,
watch: {usePolling: true} to the server config. Now, my vite.config.ts is like this:
Thank you, Malik!
Thanks @sergiomoura for pointing out this one. I am adding it to article. Hope you won't mind :)
Nice and simple demonstration. Thank you for taking the time to put this together and sharing this!
Thanks Wouter for the kind words. Surely, it will motivate me to add the GitHub link for these files as well ;)
My Workflow preferred using Shell files to automate starting up containers and scripts. But now seeing the use of make is definitely an awesome alternative, time to dig into makefiles. Great write-up
This article show how to run a Vite Dev Server in a Docker container, expose it to the port 8000 to serve a local project.. I don't understand in which circumstance we need this Docker container? You already installed vite on your local in the first step so why not run it directly with 'vite --port 8000` to serve the local project?
Hello @duongphuhiep, sorry for the late reply. It's true, I can't say anything logically that can make mistake a correct statement.
I purpose, as long as we do not use the first step, and we have a package.json with packages, then we can proceed from step two and we won't need npm/vite on the host machine.
I will test it myself and update the blog. Thanks again for pointing this out.
Good question. I can immediately think of two reasons of doing this.
Great Article, was facing some issues while containerizing web app. This article saved lot of my time.
Glad to here that :) thanks.
I like your post!
What's the reasoning behind chosing to put --no-recreate in your build?
For me, it's a matter for choice. The main reason to select this option is that I don't want to recreate my container even if something is changed in the image.
As I am using
node:alpine
which could point to different image after some time with new version of node and my system could try to download the new one and could change the whole env. It won't affect this simple project but in a big project that could cause issue.BTW Happy New Year :)