-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Dockerfile #7
base: main
Are you sure you want to change the base?
Conversation
Oh, wait. Once I upgraded the epollcat and http4s servers, it worked 🎉 |
@tanishiking thanks for working on this! FYI epollcat is heading towards deprecation, see armanbilge/epollcat#99. Instead I recommend using this pre-release of FS2, then you can use |
@armanbilge Thanks! awesome, I gonna check it out later 🎉 |
Also might be of interest: https://github.com/buntec/minimal-scala-native-http4s-server-app/ |
Dockerfile
Outdated
FROM debian:11-slim | ||
WORKDIR /app | ||
COPY --from=build-env /build/target/scala-3.3.1/scala-native-ember-example-out ./app | ||
# RUN ldd /app/app | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libssl-dev && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of doing this it would be interesting if we could statically link openssl during the build process so we don't need to install it. This seems to be very challenging to do with the @link
annotations unfortunately. That's why I think I intend to remove them in the next significant wave of releases.
One last thing I'm struggling with is that I'm not familiar with TLS and s2n, and couldn't make it work correctly 🤔 Maybe it's better to focus on finishing it without s2n for now like https://github.com/buntec/minimal-scala-native-http4s-server-app/ |
Dockerfile
Outdated
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libssl-dev && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing I'm struggling with is that I'm not familiar with TLS and s2n, and couldn't make it work correctly 🤔
When I runcurl http://localhost:8080/joke
the server gonna returns 500 because offs2.io.net.tls.S2nException: Certificate is untrusted
.
Do you need to install ca-certificates
maybe to fix that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's the case 😅 thanks!
btw ... 😂 I just remembered we also have another example repository. might be interesting to look at. |
#6
I'm also interested in build and running this app in container and deploy it to somewhere like CloudRun 😃
./build-image.sh should archive the project and build it in docker containerjustdocker build .
docker run ember-app
to run the server inhttp://localhost:8080
However, the server gonna crash with the segmentation fault on receive the request and the container would hang.fixedoutdated
Any ideas? FYI @armanbilge