Skip to content

Commit c48fa76

Browse files
authoredJun 26, 2020
Reduce images size (#1636)
## Reduce image size ~:warning: Depends on #1635 Reduce Kuzzle images size: - `kuzzleio/kuzzle:2`: from 563 Mo to 165 Mo - `kuzzleio/plugin-dev:2`: from 968 Mo to 410 Mo This PR also includes 2 new tags: - `kuzzleio/kuzzle:2-alpine`: 140 Mo - `kuzzleio/kuzzle:2-scratch`: 94 Mo I followed the tricks explained here: https://medium.com/trendyol-tech/how-we-reduce-node-docker-image-size-in-3-steps-ff2762b51d5a Also I made few other changes for the production image: - remove all object and build files (`.o`, `.h`) - add only relevant files (`lib`, `config`, `plugins`, etc) - remove `.git` - remove useless npm dependencies - minify JS - strip `re2` and `node` binaries The `scratch` image contains only Node.js (with libstdc++), musl and Kuzzle source code. ## Scripts All docker related scripts are in `docker/scripts/`: - `entrypoint.sh`: the entrypoint - `clean-node.sh`: remove every unnecessary file from a directory. If `NODE_ENV=production` then the JS and JSON files will be minified - `run-dev.sh`: used by the `core-dev` image to run a core-developer stack - `run-plugin.sh`: used by `plugin-dev` to run an application composed of plugins (like we do now) - `run-prod.sh`: used by the `kuzzle` images to run kuzzle in production ### How should this be manually tested? Build the images and play the functional tests ### Other changes - Elasticsearch initialization is now waited with the `bin/wait-elasticsearch` script instead of curl - Functional tests are run in parallel in 2 travis jobs
1 parent c81e218 commit c48fa76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+967
-419
lines changed
 

‎.babelrc

-4
This file was deleted.

‎.ci/privatebuild/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ ENV NODE_ENV=production
6868

6969
COPY --from=dependencies /var/app/ /var/app/
7070

71-
RUN ln -s /var/app/docker-compose/scripts/run.sh /usr/local/bin/kuzzle \
71+
RUN ln -s /var/app/docker/scripts/run.sh /usr/local/bin/kuzzle \
7272
&& chmod a+x /usr/local/bin/kuzzle \
73-
&& chmod a+x /var/app/docker-compose/scripts/docker-entrypoint.sh
73+
&& chmod a+x /var/app/docker/scripts/docker-entrypoint.sh
7474

75-
ENTRYPOINT ["/var/app/docker-compose/scripts/docker-entrypoint.sh"]
75+
ENTRYPOINT ["/var/app/docker/scripts/docker-entrypoint.sh"]
7676

7777
CMD ["kuzzle", "start"]
7878

0 commit comments

Comments
 (0)
Please sign in to comment.