generated from VEuPathDB/example-jaxrs-container-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (43 loc) · 1.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Build Service & Dependencies
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
FROM veupathdb/alpine-dev-base:jdk-21-gradle-8.7 AS prep
LABEL service="eda-build"
ARG GITHUB_USERNAME
ARG GITHUB_TOKEN
WORKDIR /workspace
RUN apk add --no-cache npm \
&& npm install -gs raml2html raml2html-modern-theme
# copy files required to build dev environment and fetch dependencies
COPY build.gradle.kts settings.gradle.kts ./
# download raml tools (these never change)
RUN gradle install-raml-4-jax-rs install-raml-merge
# download project dependencies in advance
RUN gradle download-dependencies
# copy raml over for merging, then perform code and documentation generation
COPY api.raml ./
COPY schema schema
RUN gradle generate-jaxrs generate-raml-docs
# copy remaining files
COPY . .
# build the project
RUN gradle clean test shadowJar
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Run the service
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
FROM amazoncorretto:21-alpine3.20
LABEL service="eda-service"
RUN apk add --no-cache tzdata \
&& cp /usr/share/zoneinfo/America/New_York /etc/localtime \
&& echo "America/New_York" > /etc/timezone
ENV JAVA_HOME=/opt/jdk \
PATH=/opt/jdk/bin:$PATH \
JVM_MEM_ARGS="" \
JVM_ARGS=""
COPY startup.sh startup.sh
COPY --from=prep /workspace/build/libs/service.jar /service.jar
CMD ./startup.sh