-
Notifications
You must be signed in to change notification settings - Fork 64
/
Dockerfile
43 lines (29 loc) · 1.13 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
FROM openjdk:17-slim
# Argument for JAR file name to use in working directory:
ARG JAR_FILE
# Set working directory
WORKDIR /app
RUN mkdir -p /app
# Copy the specified JAR file into the container
COPY ${JAR_FILE} /app/application.jar
COPY docker/entrypoint.sh /app/entrypoint.sh
# Set permissions for the entrypoint script
RUN chmod +x /app/entrypoint.sh
# Expose application port
EXPOSE 8080
# Use a non-root user
RUN addgroup --system projectforge && adduser --system --ingroup projectforge projectforge
# Install findutils (xargs needed by gradle)
#RUN apt-get update && apt-get install -y findutils && rm -rf /var/lib/apt/lists/*
# pgrep needed by the entrypoint.sh
RUN apt-get update && apt-get install -y procps && rm -rf /var/lib/apt/lists/*
# Expose the port and declare the volume
RUN mkdir -p /ProjectForge && chown -R projectforge:projectforge /ProjectForge
VOLUME /ProjectForge
COPY docker/environment.sh /ProjectForge
# Switch to the non-root user
USER projectforge:projectforge
# Run the Spring Boot application
ENTRYPOINT ["/app/entrypoint.sh"]
# ENTRYPOINT ["java", "-jar", "/app/application.jar"]
LABEL maintainer="Micromata"