-
Notifications
You must be signed in to change notification settings - Fork 102
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
Simple implementation of Docker for development and production #96
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
LGTM. Has it been tested?
docker/Dockerfile.dev
Outdated
@@ -0,0 +1,11 @@ | |||
FROM node:14-alpine |
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.
Try using a slim image instead.
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.
Try using a slim image instead.
Apart of the size and the distro, what's the difference between alpine and slim?
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's not much. It's mostly the same, except Alpine is a completely separate distro of it's own.
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.
Well, for development has sense to use slim because being a debian distro there are chances to install any additional package with apt, as for production I prefer to keep it with alpine since the smaller the image the better
@@ -0,0 +1,10 @@ | |||
version: '3.8' | |||
|
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.
Try adding restart: on-failure
for cases when it fails
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.
Try adding
restart: on-failure
for cases when it fails
I've added the restart property for production, before I've added it for development too but now I've removed it
@ppastene Are you working on making the requested changes? |
Woah, I've forgot about this. But yeah, I can make it work again and update the README.MD |
Someone is attempting to deploy a commit to a Personal Account owned by @max-programming on Vercel. @max-programming first needs to authorize it. |
I'm still working with the pull request, I barely got any time because of my job and being a PR from last year so maybe I need to update the Dockerfiles. |
@max-programming Got some news. I've updated the dockerfiles and now it runs on a dev environment including hot reload for editing, and also for production by building the app, copying to a fresh image and run it from there improving the container size and performance. The only problem I have is the app ask me for the xata.io apiKey everytime it builds so for development is not a problem in a first stance but for production next.js will not build without the apiKey. Is there a chance to run the app without the apiKey? |
Yes the app can be run without API key. For production I have set it up on Vercel already. I'm yet to test the dockerfile but it looks like it'll work |
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.
lgtm
@ppastene sorry for the delay. Can you please fix the conflicts? |
Simple implementation of Docker to 'dockerize' the project intended for development (using yarn dev) and production (using yarn build and yarn start). I've used
https://github.com/vercel/next.js/tree/canary/examples/with-docker-multi-env
as a base for this PR.The only missing was to update the README.md to incluide the Makefile commands to run the project into Docker