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

Reduce docker image from 1.39 GB to 611 MB #341

Merged
merged 2 commits into from
Jan 30, 2024
Merged

Reduce docker image from 1.39 GB to 611 MB #341

merged 2 commits into from
Jan 30, 2024

Conversation

guimard
Copy link
Member

@guimard guimard commented Jan 23, 2024

Just to reduce size

@@ -13,10 +13,12 @@ RUN apt update -y

RUN apt install --assume-yes nextcloud-desktop-cmd

RUN apt install ldap-utils
RUN apt install -y ldap-utils
Copy link
Member Author

Choose a reason for hiding this comment

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

Was missing, this break build when updates are available


RUN apt update && apt -y dist-upgrade
RUN apt install dirmngr
RUN apt install -y gnupg
Copy link
Member Author

Choose a reason for hiding this comment

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

The dirmngr should be replaced by gnupg: enough here and lighter

CMD ["npm", "run", "start"]
#CMD ["npm", "run", "start"]

FROM updated
Copy link
Member Author

Choose a reason for hiding this comment

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

no need to copy the environment, since we're using @rollup/plugin-node-resolve, nothing is useful except the generated JS itself

COPY --from=1 /usr/src/app/dist/* /
RUN mv express_server.js express_server.mjs

CMD ["node","express_server.mjs"]
Copy link
Member Author

Choose a reason for hiding this comment

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

no need to have npm to run a single command

Copy link
Member

Choose a reason for hiding this comment

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

I'll test one more time with modules, due to a problem we had yesterday with compiling ts and creating a bundle with a rollup
and thank you, Xavier!)

@shepilov shepilov merged commit 1ade3de into main Jan 30, 2024
2 checks passed
@shepilov shepilov deleted the optimize-docker branch January 30, 2024 11:28
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