This repository has been archived by the owner on Dec 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (33 loc) · 1.4 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
# Use an official java runtime as a parent image
FROM openjdk:8-jre-alpine
#FROM maven:3-alpine
# Define environment variable
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
SLEEP=10\
JAVA_OPTS="-Xmx512m -Xms256m"\
SNAPANONYM_DB_HOST=172.31.81.47\
SNAPANONYM_DB_PORT=3307\
SNAPANONYM_DB_NAME=snapanonyme\
SNAPANONYM_DB_USER=snapanonyme\
SNAPANONYM_DB_PASSWORD=snapanonyme\
SPRING_ACTIVE_PROFILES=prod
# Add a snapanonyme snaper to run our application so that it doesn't need to run as root
RUN adduser -D -s /bin/sh snapanonyme
#COPY pom.xml /home/snapanonyme
#COPY src/ /home/snapanonyme/src
# Set the current working directory to /home/snapanonyme
WORKDIR /home/snapanonyme
#RUN mvn clean install -Dmaven.test.skip=true
#copy the app to be deployed in the container
ADD target/snapanonyme.jar snapanonyme.jar
#create a file entrypoint-dos.sh and put the project entrypoint.sh content in it
ADD entrypoint.sh entrypoint-dos.sh
#Get rid of windows characters and put the result in a new entrypoint.sh in the container
RUN sed -e 's/\r$//' entrypoint-dos.sh > entrypoint.sh
#set the file as an executable and set snapanonyme as the owner
RUN chmod 755 entrypoint.sh && chown snapanonyme:snapanonyme entrypoint.sh
#set the snaper to use when running the image to snapanonyme
USER snapanonyme
# Make port 9010 available to the world outside this container
EXPOSE 9010
ENTRYPOINT ["./entrypoint.sh"]