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
chore: unified dockerfile #1840
Conversation
Talked with @bastienbeurier we agreed on this solution, as long as we communicate and document the change. |
Can I have a review on this @khaliqgant @TBonnin? thanks |
Thanks Samuel. I think this makes sense, but the work here should be captured in a project within our ticketing system. I say that to make sure we encompass the impacted pieces of this change as a checklist of sorts.
|
Good point I created a Linear project https://linear.app/nango/project/unified-dockerfile-1a4273be8741 |
ENV IMAGE_ENV $image_env | ||
ENV GIT_HASH $git_hash | ||
|
||
EXPOSE 8080 |
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.
do we currently use port 80. That would require an infra change if yes
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.
locally we use 300x
on render we pass port in an env var, e.g:NANGO_JOBS_PORT
I don't think it will be much more complicated than changing the env var but my test on staging will tell us
Note
This is a proposal, open to debate.
Context
Fixes NAN-596
We currently maintain 4 Dockerfiles, and need to build 7 in total. I feel like it's a lot to maintain. As we grow we will add more images and more folder in packages which can results in more stuff being build for nothing and errors.
I would love to reduce this maintenance to 3 images (
staging
,prod
,enterprise
) and down to 1 if possible. Right now we need many versions also because we pass dedicated env vars to the Webapp build which is something we could do differently (e.g: serving those via API calls)Proposal
nangohq/nango
It's currently 148MB (compressed) hub.docker.com vs
nangohq/nango
is 145MB. So the difference is already minimal enough that it doesn't really matter.NB: the image is private rn
NB: I disabled build for
entreprise
for the moment. I feel like it would be a waste of time and if we manage to get rid of the Env Vars situation, the single image could serve this scenario.Migration
If we agree the migration path is not urgent. We just need to take the time to do it when we want.
E.g for jobs:
nangohq/jobs:production
tonangohq/nango:prod-<hash>
Docker Command
, e.g:node packages/jobs/dist/app.js
NB: this should also solve our docker caching issue
Should we keep the other images?
In the long-term I feel like it's not really useful, I think what other projects are doing is perfect with only 2-3 images: