-
Notifications
You must be signed in to change notification settings - Fork 53
/
tables-service.Dockerfile
47 lines (32 loc) · 1.11 KB
/
tables-service.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
FROM openjdk:23-ea-11-slim
ARG USER=openhouse
ARG USER_ID=1000
ARG GROUP_ID=1000
ENV APP_NAME=tables
ENV USER_HOME=/home/$USER
# Create an openhouse user as there's no reason to run as root user
RUN groupadd --force -g $GROUP_ID $USER && useradd -l -d $USER_HOME -m $USER -u $USER_ID -g $GROUP_ID
WORKDIR $USER_HOME
# IMAGE does not set the necessary paths by default.
ENV PATH=$PATH:/export/apps/jdk/JDK-1_8_0_172/bin/:$USER_HOME
ARG VERSION="1.0.0-SNAPSHOT"
ARG BUILD_DIR="build/$APP_NAME/libs"
ARG JAR_FILES=$BUILD_DIR/*.jar
COPY $JAR_FILES ./
# Delete unwanted JAR files
RUN ls ./
RUN find . -name "*-sources.jar" -delete
RUN find . -name "*-javadoc.jar" -delete
RUN find . -name "*-lib.jar" -delete
# Rename the JAR file.
RUN ls ./
RUN find ./ -name "*.jar" -exec mv {} $APP_NAME.jar \;
RUN ls $APP_NAME.jar
COPY run.sh .
# Ensure that everything in $USER_HOME is owned by openhouse user
RUN chown -R openhouse:openhouse $USER_HOME
# Setup default path for Java
RUN mkdir -p /usr/java && ln -sfn /export/apps/jdk/JDK-1_8_0_172 /usr/java/default
USER $USER
EXPOSE 8080
ENTRYPOINT ["sh", "-c", "./run.sh $APP_NAME.jar $@"]