forked from hwslabs/grpc-kotlin-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker support for running the server inside a container
- Loading branch information
1 parent
d0a954c
commit 7fa2991
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM openjdk:8 AS builder | ||
ENV APP_HOME=/usr/app/ | ||
WORKDIR $APP_HOME | ||
COPY build.gradle* settings.gradle* gradle* $APP_HOME | ||
COPY gradle $APP_HOME/gradle | ||
RUN ./gradlew build || return 0 | ||
COPY . . | ||
RUN ./gradlew installDist | ||
|
||
FROM openjdk:8 AS runner | ||
ENV APP_HOME=/usr/app/ | ||
ENV EXECUTABLE_NAME=bar-server | ||
WORKDIR $APP_HOME | ||
COPY --from=builder $APP_HOME/server/build/ . | ||
EXPOSE 50051 | ||
CMD ./install/server/bin/$EXECUTABLE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: "3" | ||
services: | ||
app: | ||
build: . | ||
ports: | ||
- "50051:50051" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters