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

Adding Dockerfile and example docker-compose.yml #186

Closed
wants to merge 8 commits into from

Conversation

TetrisBlack
Copy link

Adding support for docker, like in the example of next.js https://github.com/vercel/next.js/tree/canary/examples/with-docker

Note:
I have not tested the application itself. I did build and start the docker container and created an account (to test the db connection). I'm also not a React guy, the addition to the next.config.js was taken out of the linked example of next.js

Related Issue:
#86

@TetrisBlack TetrisBlack changed the title Adding Dockerfile and example docker-compose,yml Adding Dockerfile and example docker-compose.yml Apr 14, 2022
@anandbaburajan
Copy link
Member

@TetrisBlack thank you for the PR! May I know why you closed this?

@TetrisBlack
Copy link
Author

@anandbaburajan sure.
After some testing, I got a problem with the env's not changing, then using the next experimental standalone option. It seems like the frontend always has the wrong env's. The backend connection to the MongoDB could be configured via env's. So, my assumption is, that the next build is compiling the frontend code with the currently defined env as a static and not as a dynamic value.

I found the with-docker-multi-env repo. With, let me think, that the env needs to be set before the build. That would not be in the intention of a configurable docker container.

I don't think that the official way of next, to build docker container is working in this project. To make the project possible for docker, you would need to build the application on container startup with the needed env's defined. But that would mean that the docker image will be huge and has a slow startup. (The official way is 123 MB right now)

So the reason why I closed my pull request is, that it don't work like it should be.

@anandbaburajan
Copy link
Member

@TetrisBlack thank you for the kickstart! I'm new to Docker so your comment is really valuable. I'll look further into it.

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.

2 participants