-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (28 loc) · 1.19 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
FROM ghcr.io/arosbio/cpsign-cp-reg-server:latest-full
LABEL org.opencontainers.image.source=https://github.com/pharmbio/cplogd-v2.0
LABEL org.opencontainers.image.description="CPSign model for predicting cpLogD - version 2"
LABEL org.opencontainers.image.url=https://github.com/pharmbio/cplogd-v2.0
LABEL org.opencontainers.image.version=v2
LABEL org.opencontainers.image.authors="Staffan Arvidsson McShane"
LABEL org.opencontainers.image.title="cpLogD prediction service version 2"
# Copy the model itself to the image
COPY trained-model.jar /var/lib/jetty/model.jar
# Change to root user to create a new user and change directory ownership
USER root
ENV USER=jetty2
ENV HOME=/home/$USER
# Create the user 1000
RUN useradd -m -u 1000 $USER
# Set working directory (this is where the code should go)
WORKDIR $HOME/app
# Copy the required startup script
COPY start-script.sh $HOME/app/start-script.sh
# Make startup script runnable and change user
RUN chmod +x start-script.sh \
&& chown -R $USER:$USER $HOME \
&& chown -R $USER:$USER /var/lib/jetty/ \
&& chown -R $USER:$USER /usr/local/jetty \
&& rm -rf /var/lib/apt/lists/*
# Set the required user
USER $USER
ENTRYPOINT ["./start-script.sh"]