-
-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(deployment): docker file for vitesse #378
Conversation
|
||
WORKDIR /root/app | ||
COPY . . | ||
RUN pnpm i --prod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why --prod is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to prevent dev dependencies to be installed. there are a lot of things we don't need such as cypress that gets installed if we don't pass that flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you need to build the app, you need the dev deps. Have you tested it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it builds fine and I could also open the instance in the browser with everything working including all the CSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'd trust you then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm dependencies and devDependencies
I assumed that dev deps are only used for development phase and vitesse package json respected that information which clearly didn't, I have no Idea why it ran perfectly fine when I tested the dockerfile 3 days ago. on a fresh clone it doesn't work as @hannoeru shows it. I would recommend moving every critical build dependency from dev deps to reqular deps in package.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mhdi-kr What is the purpose of this Dockerfile? Production or Development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for production, I personally run my development tasks on my own machine rather than containers. @hannoeru
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed that dev deps are only used for development phase and vitesse package json respected that information which clearly didn't
because vite preview
is not made for production usage, we should build vite app first then serve it as static contents, so we don't need any dependencies on production.
I have no Idea why it ran perfectly fine when I tested the dockerfile 3 days ago. on a fresh clone.
I think is because you didn't exclude node_modules
from docker build, so if you installed dependencies on you local machine then build the docker container the exist dependencies will still stay there, that is why the build didn't failed.
Hi Anthony. I added a dockerfile for the vitesse template with adequate documentation of usage in the markdown. hope this helps,