Skip to content

feat: drastically shrink the docker image, also build for arm64 #1109

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Docteh
Copy link
Contributor

@Docteh Docteh commented May 18, 2025

Right now the generated docker container contains a copy of the development environment used to compile the revite interface.
This PR loses about 440MB compressed, or around 800MB uncompressed from the final image size. node in the final image has been bumped from 16 to 24, sirv-cli, and the dependencies for inject.js have been updated

The container still holds a copy of the source code, it's not too big. the node modules are the size concern.

cut from docker image ls
REPOSITORY                                TAG                IMAGE ID       CREATED             SIZE
ghcr.io/docteh/revolt-revite   (this pr)  master             2e6cd9d35eed   59 minutes ago      226MB
ghcr.io/revoltchat/client      (current)  master             9ded77d2d429   5 days ago          1.01GB

Regarding moving disabled-js.svg to public/disabled-js.svg, it fixes the broken image if anyone visits the web interface with javascript disabled. It also gets a lone image out of the root of the repository.

Start:
/usr/src/app # du -d 1
20      ./scripts
44024   ./node_modules
58800   ./dist
3492    ./src
1764    ./public
7588    ./.git
186392  ./.yarn
773244  ./external
1075776 .

Finish:
/usr/src/app # du -d 1
58980   ./dist_injected
16      ./docker
20      ./scripts
58948   ./dist
3488    ./src
1768    ./public
828     ./node_modules
124152  .

image

image

Please make sure to check the following tasks before opening and submitting a PR

  • I understand and have followed the contribution guide
  • I have tested my changes locally and they are working as intended
  • These changes do not have any notable side effects on other Revolt projects
    * [ ] (optional) I have opened a pull request on the translation repository
  • I have included screenshots to demonstrate my changes

Docteh added 3 commits May 18, 2025 01:29
The box where githubs container website complains about a lack
a description is really big. Okay its not important.
Right now the generated docker container contains a copy of the development environment used to compile the revite interface.
This PR loses about 440MB compressed, or around 800MB uncompressed from the final image size. node in the final image has been bumped from 16 to 24, sirv-cli, and the dependencies for inject.js have been updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 Untriaged
Development

Successfully merging this pull request may close these issues.

1 participant