-
Notifications
You must be signed in to change notification settings - Fork 44
Bundle docs_ai_backend #727
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
Conversation
Let's change "start" script to "node ./path to server.js"? |
I see that standalone dir still contains some |
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 are two main issues that need to be investigated here. Both of them arise if the suggestion by @ukorvl is applied (i.e., the app is started via next ./node .next/standalone/docs_ai_backend/server.js
.
-
The app starts on port
3000
by default but the production machine will expect it at port8092
. Probably the port can be specified when the app is launched directly in the command. -
Requests to
/api/services/db
do not work and they are needed to renew the DB. Specific error is:
[TypeError: fetch failed] {
[cause]: [Error: getaddrinfo EAI_AGAIN undefined] {
errno: -3001,
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'undefined'
}
}
If the app is launched via npm run start
, the request works normally.
It looks like it's not very difficult to bundle all necessary npm dependencies together with the docs_ai_backend. What is needed is just to specify `output: standalone` in the next.js config. I've tried to start the server with `node` from the resulting build and it worked. However, I can't do any in-depth testing and will wait for Shukhrat to do that part. testong fixed the DNS error and made the app launch using the correct port fixes
ddb911a
to
92ce4cc
Compare
Short Summary
It looks like it's not very difficult to bundle all necessary npm dependencies together with the docs_ai_backend. What is needed is just to specify
output: standalone
in the next.js config.I've tried to start the server with
node
from the resulting build and it worked. However, I can't do any in-depth testing and will wait for Shukhrat to do that part.Related Issue
Part of #728
Breaking Changes (if any)
It is possible that I didn't ship everything that is needed in the resulting distribution, so help is needed.
Checklist
Please mark each item with an
x
inside the brackets (e.g., [x]) once completed.