forked from jd-opensource/joylive-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (32 loc) · 974 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Build an image using JDK 17
FROM openjdk:17-oracle AS builder
# Set up a working directory
WORKDIR /app
# Copy the project file to the working directory
COPY . .
# Build the project
RUN ./mvnw clean package -DskipTests=true
# Use a smaller base image
FROM alpine
# Set the time zone and locale
ARG TZ="Asia/Shanghai"
ENV TZ ${TZ}
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LANGUAGE en_US:en
RUN set -ex \
&& apk add --no-cache bash tzdata unzip ca-certificates \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone
# Create a target directory
RUN mkdir -p /joylive
# Copy the zip file generated during the build phase and extract it
COPY --from=builder /app/joylive-package/target/*.zip /joylive/
RUN unzip /joylive/*.zip -d /joylive/ \
&& rm /joylive/*.zip
# Set up a working directory
WORKDIR /joylive
RUN mkdir /joylive/log
RUN mkdir /joylive/output
VOLUME ["/joylive/log", "/joylive/config"]
CMD ["true"]