Skip to content
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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

ppastene
Copy link

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

@vercel
Copy link

vercel bot commented Oct 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hacktoberfest-projects ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2023 0:43am

Copy link
Collaborator

@janaSunrise janaSunrise left a 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?

@@ -0,0 +1,11 @@
FROM node:14-alpine
Copy link
Collaborator

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.

Copy link
Author

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?

Copy link
Collaborator

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.

Copy link
Author

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'

Copy link
Collaborator

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

Copy link
Author

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

@max-programming
Copy link
Owner

@ppastene Are you working on making the requested changes?

@ppastene
Copy link
Author

ppastene commented Oct 6, 2023

@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

@vercel
Copy link

vercel bot commented Oct 11, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @max-programming on Vercel.

@max-programming first needs to authorize it.

@ppastene
Copy link
Author

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.

@ppastene
Copy link
Author

ppastene commented Oct 14, 2023

@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?

@max-programming
Copy link
Owner

@ppastene

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

Copy link
Collaborator

@janaSunrise janaSunrise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@max-programming
Copy link
Owner

@ppastene sorry for the delay. Can you please fix the conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants