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

Docker image - #3 #6

Merged
merged 8 commits into from
Oct 7, 2019
Merged

Docker image - #3 #6

merged 8 commits into from
Oct 7, 2019

Conversation

vincenzobaz
Copy link
Contributor

I started to hack around in your sbt config to create a dockerfile when I realized you are already using sbt-native-packager.
The plugins allows to build a docker image with minimal config.

This PR adds simple configuration to build.sbt.
To create the docker image just run sbt docker:publishLocal.
A new docker image image will be created which you can then simply run mapping a port on your host to port 8080, e.g -p 9999:8080.

Let me know if this what you had in mind for issue #3 or if you want a Dockerfile built from scratch.

@tg44
Copy link
Member

tg44 commented Oct 6, 2019

Hy!

Thanks the contribution!
I would go closer to sth like this: https://github.com/TeamWanari/tutelar/blob/master/Dockerfile
Where the DockerFile can build an "optimal" deploy container.

@vincenzobaz
Copy link
Contributor Author

Hello!
You're welcome :)

I created something similar to your link.

Please note that my previous PR used the native packager to create a native executable while the link you mention creates java executables, so things are a bit different

@tg44
Copy link
Member

tg44 commented Oct 7, 2019

Some smaller things:

In general the sbt-assembly is not a good choice over the native-packager, bcs assembly is repacking all the dependencies. If you have any cryptography in your code, you probably use libs whose use apis whose need signed jar-s (for ex. bouncycastle), and when you repack, you loose the signs, and even better you got runtime exceptions at appstart... (We have no security here so its ok for this project.)
Ofc. if you want to distribute the app to end-users (like a desktop app) assembly is usually better. Users like the single file solutions.

For these reasons our general use-case is to build with native-packager and move the files to a "small" container.

One more thing: .dockerignore can be a gamechanger :) It's irrelevant here also, but a good-to-know thingy!

@tg44 tg44 merged commit bc0bd22 into TeamWanari:master Oct 7, 2019
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