Skip to content

Instantly share code, notes, and snippets.

@lucasrpb
Last active December 6, 2021 14:15
Show Gist options
  • Save lucasrpb/165c4f86278c0af39d168f74c47b070c to your computer and use it in GitHub Desktop.
Save lucasrpb/165c4f86278c0af39d168f74c47b070c to your computer and use it in GitHub Desktop.

Docker file: Dockerfile

FROM openjdk:17.0.1-slim

# Copy the jar to the production image from the builder stage.
COPY /target/scala-2.13/service.jar /service.jar
COPY secure-connect-test.zip /secure-connect-test.zip

# Run the web service on container startup.
CMD ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "service.jar"]

#EXPOSE 3000

# [END run_helloworld_dockerfile]
# [END cloudrun_helloworld_dockerfile]

Docker building:

docker build -t my-service-app .

Docker tagging for Google Cloud:

docker tag my-service-app gcr.io/<project_id>/my-service

Docker pushing image to Google Cloud Registry

docker push gcr.io/<project_id>/my-service

Grpc project with Akka and AstraDB (Cassandra) example

https://github.com/lucasrpb-learning/akka-grpc-cloud-run

Deploying to Google Cloud Run

-- Dont forget to enable HTTP2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment