-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (27 loc) · 902 Bytes
/
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
# Repo: https://github.com/poshjosh/bcsafecontentservice
# @see: https://spring.io/guides/topicals/spring-boot-docker/
# ---------------------------------------------------
FROM openjdk:8-jdk-alpine
LABEL maintainer="posh.bc@gmail.com"
VOLUME /tmp
COPY start.sh .
# Privileged action that should run before changing to non-root user
# ------------------------------------------------------------------
RUN chmod +x /start.sh
# Create and use non-root user
# ---------------------------
RUN addgroup -S poshjosh && adduser -S poshjosh -G poshjosh
USER poshjosh
ARG DEPENDENCY_DIR=target/dependency
# for Spring Boot
COPY ${DEPENDENCY_DIR}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY_DIR}/META-INF /app/META-INF
# for Spring Boot
COPY ${DEPENDENCY_DIR}/BOOT-INF/classes /app
ARG DEBUG
ENV DEBUG=$DEBUG
ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS
ARG MAIN_CLASS
ENV MAIN_CLASS=$MAIN_CLASS
ENTRYPOINT ["/start.sh"]