-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from ga4gh/feature/issue-28-dockerize
dockerize app and test dockerized service
- Loading branch information
Showing
25 changed files
with
741 additions
and
29 deletions.
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
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,64 @@ | ||
################################################## | ||
# BUILDER CONTAINER | ||
################################################## | ||
|
||
FROM openjdk:11.0.12 as builder | ||
|
||
USER root | ||
|
||
WORKDIR /usr/src/dependencies | ||
|
||
# INSTALL MAKE | ||
RUN apt update \ | ||
&& apt install build-essential -y | ||
|
||
# INSTALL SQLITE3 | ||
RUN wget https://www.sqlite.org/2021/sqlite-autoconf-3340100.tar.gz \ | ||
&& tar -zxf sqlite-autoconf-3340100.tar.gz \ | ||
&& cd sqlite-autoconf-3340100 \ | ||
&& ./configure \ | ||
&& make \ | ||
&& make install | ||
|
||
# USER 'make' and 'sqlite3' to create the dev database | ||
COPY Makefile Makefile | ||
COPY database/sqlite database/sqlite | ||
RUN make sqlite-db-refresh | ||
|
||
################################################## | ||
# GRADLE CONTAINER | ||
################################################## | ||
|
||
FROM gradle:7.3.3-jdk11 as gradleimage | ||
|
||
WORKDIR /home/gradle/source | ||
|
||
COPY build.gradle build.gradle | ||
COPY gradlew gradlew | ||
COPY settings.gradle settings.gradle | ||
COPY src src | ||
|
||
RUN gradle wrapper | ||
|
||
RUN ./gradlew bootJar | ||
|
||
################################################## | ||
# FINAL CONTAINER | ||
################################################## | ||
|
||
FROM adoptopenjdk/openjdk12:jre-12.0.2_10-alpine | ||
|
||
USER root | ||
|
||
ARG VERSION | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# copy jar, dev db, and dev resource files | ||
COPY --from=gradleimage /home/gradle/source/build/libs/ga4gh-testbed-api-${VERSION}.jar ga4gh-testbed-api.jar | ||
COPY --from=builder /usr/src/dependencies/ga4gh-testbed-api.dev.db ga4gh-testbed-api.dev.db | ||
COPY src/test/resources/ src/test/resources/ | ||
|
||
RUN chmod 666 ga4gh-testbed-api.dev.db | ||
|
||
ENTRYPOINT ["java", "-jar", "ga4gh-testbed-api.jar"] |
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
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 @@ | ||
export DOCKER_IMG_VER=`cat build.gradle | grep "^version" | cut -f 2 -d ' ' | sed "s/'//g"` |
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
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
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,7 @@ | ||
version: "3.9" | ||
services: | ||
testbed-api: | ||
image: ga4gh/ga4gh-testbed-api:test | ||
hostname: testbed.ga4gh.org | ||
ports: | ||
- "4500:4500" |
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
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
Oops, something went wrong.