forked from NCIEVS/evsrestapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (28 loc) · 1.24 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
# Base image
FROM centos:7
MAINTAINER Frankie Parks <[email protected]>
ENV TZ=America/New_York
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone
# Update all packages installed for security
RUN yum makecache && yum update -y
# Create a user and group used to launch processes
# The user ID 1000 is the default for the first "regular" user on Fedora/RHEL,
# so there is a high chance that this ID will be equal to the current user
# making it easier to use volumes (no permission issues)
RUN groupadd -r evsapi -g 1000 && useradd -u 1000 -r -g evsapi -m -d /opt/evsapi -s /sbin/nologin -c "EVSAPI user" evsapi && \
chmod 755 /opt/evsapi
# Set the working directory to evsapi' user home directory
WORKDIR /opt/evsapi
# Install necessary packages
RUN yum -y install java-1.8.0-openjdk-devel unzip && yum clean all
# Set ENV variable for EVS_SERVER_PORT
ENV EVS_SERVER_PORT="5830"
ENV JAVA_OPTIONS="-Xmx2048m -XX:PermSize=1024m -XX:MaxPermSize=512m"
# Add file files to image
ADD build/distributions/evsrestapi-1.0.0-SNAPSHOT.zip /opt/evsapi/
RUN unzip evsrestapi-1.0.0-SNAPSHOT.zip
RUN ln -s evsrestapi-1.0.0-SNAPSHOT evsrestapi
RUN ls -l
EXPOSE 5830
USER evsapi
CMD java -jar ./evsrestapi/lib/evsrestapi.war