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

chore: reduce docker image #929

Merged
merged 3 commits into from
Jun 3, 2020
Merged

chore: reduce docker image #929

merged 3 commits into from
Jun 3, 2020

Conversation

septs
Copy link
Contributor

@septs septs commented Apr 14, 2020

modify before:
➜  gun git:(master) ✗ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
dimensiondev/gun    latest              743834bacd95        17 minutes ago      156MB
alpine              latest              a187dde48cd2        3 weeks ago         5.6MB

modify after:
➜  gun git:(master) ✗ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
dimensiondev/gun    latest              00f9620bf448        5 seconds ago       89.4MB
alpine              latest              a187dde48cd2        3 weeks ago         5.6MB

156 MiB - 89.4 MiB = saved 66.6 MiB

Reference:
https://docs.npmjs.com/cli/install

@septs
Copy link
Contributor Author

septs commented Apr 14, 2020

CC @amark

@amark
Copy link
Owner

amark commented May 16, 2020

@septs 👏 👏 yaaay!

Sooooo sorry I'm behind on so many things, especially GitHub if not tagged/notified in chat room.

This looks great!

Dumb Q tho... SEA cryptography libraries are listed as optional (cause you can technically use GUN without SEA), however on Heroku & other places I often do a "full" npm install with no prune, so that way default GUN will have SEA running on the relay peers.

Would / (I'm guessing?) passing this flag disable/prevent default Docker images from running SEA, because let's say... the optional cryptography libraries don't get installed?

Very happy to have contributors like you tho cause :P when it comes to Docker I'm like a blind headless chicken, so I trust & depend on the community for stuff like this. I just want to make sure various quirks I am aware of... are also known to others, in case I messed things up?

@septs
Copy link
Contributor Author

septs commented May 16, 2020

With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.

reference:
https://docs.npmjs.com/cli/install#description

@septs
Copy link
Contributor Author

septs commented May 17, 2020

Note: We never got https://hub.docker.com/r/gundb/gun owner responded


Use Docker Hub automated build function.
If you bind the repository, commit to master branch trigger automation build to docker image latest tag
See https://docs.docker.com/docker-hub/builds/

image
image

@amark
Copy link
Owner

amark commented Jun 3, 2020

Thanks. Do you also want to update the README to point docker peeps to this one?

Merging!

I still don't quite understand whether --production will install optionalDependencies or not? I hope it does, SEA should be on any docker system by default.

@amark amark merged commit 6d02684 into amark:master Jun 3, 2020
@septs septs deleted the feature/reduce-docker-image branch August 2, 2020 07:03
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.

2 participants