-
Notifications
You must be signed in to change notification settings - Fork 94
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
WIP: Dockerize the application #3
Conversation
docs: Fixed various typos in the README.MD. fix: Added an example POSTGRES_URL as most people won't understand exactly what format it requires.
@Maelstromeous is attempting to deploy a commit to the aerotow's projects Team on Vercel. A member of the Team first needs to authorize it. |
hi @Maelstromeous , thanks for getting this rolling. Is it already working? Or is this a WIP? Would like to not merge to master before this being finished including a tutorial in the main readme |
Hey @aerotow, PR is a draft and is WIP atm :) I'll ping you when it's ready for review. I like doing drafts so people can peer in on what my intent is and offer suggestions. Also I reached out to you in Reddit chat, you probably missed it, can also talk here. |
I was hoping we could leverage some sort of internal cron rather than requiring an external service to do it, but out of scope for this PR. |
Teiggering the api every 30 mins will be critical also in the docker env. Without it, the app basically has no functionality as it then does not change the temperature over time |
I can make it work, but please note #4, it may create two pathways to operating cronjobs, ideally it should be done in the codebase itself with a user defined crontab. I'm not massively familar with NextJS, I know this is 100% possible in NestJS though (I'm not suggesting we swap to that). |
Currently majorly struggling getting the migrations to run within the container. Banging my head against a wall with this one...
I've tried every combination I can think of:
I think there's something wrong with the lockfile where it refuses to run under AMD64 images, which is what most people will be running them on servers under. I may have to build a small pipeline to build both ARM and x64 copies of the image and have docker correctly pick the right one. But, I believe due to the fact in the lockfile it's targeting darwin (arm), it's getting it's knickers proper in a twist. |
Nvm realised what I was doing... I was volume mounting the container's /app directory with the local directory, done that so many times in app development in the past I totally didn't realise I was effectively re-mounting node_modules despite building them in the image. I may need more sleep. |
Current challenge is now to swap out the Vercel postgres driver to use a local postgres database connection. It appears it is not a simple process as it really should be. Reading this thread, I'm not the only one who's hit this issue. Unless there's a simplistic way of resolving that after a recharged brain tomorrow, I may abandon this. |
…. Boy that was a journey.
@aerotow Got it into a state now where the app will run the migrations and effectively talk to the database without any errors. However, when I run the app locally, even with You should be able to replicate it by simply doing a git pull on my branch and running |
I've narrowed it down to saving the EightSleep tokens to the database, will investigate further. There's a network timeout. |
Now more properly swapping out the database client for a local postgres version for Drizzle. Apologies for the verbosity! TODO:
|
…ging locally the execution path
…ging locally the execution path
… is a vercel recommended means of doing it.
Closes #2
TODO: