-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
32 lines (30 loc) · 1.33 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
# syntax=docker/dockerfile:experimental
FROM maven:3-openjdk-11 as mvn
COPY ./game-engine.core /tmp/game-engine.core
COPY ./game-engine.web /tmp/game-engine.web
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y nodejs npm git && rm -rf /var/lib/apt/lists/*
RUN npm install -g bower
WORKDIR /tmp/game-engine.core
RUN cd /tmp/game-engine.web/src/main/resources/consoleweb-assets && bower --allow-root install
RUN --mount=type=cache,target=/root/.m2,source=/.m2,from=smartcommunitylab/gamification-engine:cache mvn install -DskipTests
WORKDIR /tmp/game-engine.web
RUN --mount=type=cache,target=/root/.m2,source=/.m2,from=smartcommunitylab/gamification-engine:cache mvn install -DskipTests
FROM eclipse-temurin:11-alpine
ARG VER=3.0.0
ARG USER=gamification
ARG USER_ID=1005
ARG USER_GROUP=gamification
ARG USER_GROUP_ID=1005
ARG USER_HOME=/home/${USER}
ENV FOLDER=/tmp/target
#dslab.playandgo.engine-1.0.jar
ENV APP=game-engine.web
ENV VER=${VER}
# create a user group and a user
RUN addgroup -g ${USER_GROUP_ID} ${USER_GROUP}; \
adduser -u ${USER_ID} -D -g '' -h ${USER_HOME} -G ${USER_GROUP} ${USER} ;
WORKDIR ${USER_HOME}
COPY --chown=gamification:gamification --from=mvn /tmp/game-engine.web/target/${APP}.jar ${USER_HOME}
USER gamification
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar ${APP}.jar --spring.profiles.active=sec"]