-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
87 lines (72 loc) · 2.1 KB
/
Copy pathDockerfile
File metadata and controls
87 lines (72 loc) · 2.1 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM node:20-bookworm-slim AS frontend
WORKDIR /workspace/web
COPY web/package*.json /workspace/web/
RUN npm ci
COPY web /workspace/web
RUN npm run build
FROM maven:3.9.9-eclipse-temurin-17 AS builder
WORKDIR /workspace
COPY pom.xml /workspace/pom.xml
COPY config.example.yml /workspace/config.example.yml
COPY src /workspace/src
COPY --from=frontend /workspace/web/dist /workspace/web/dist
RUN mvn -DskipTests -Dskip.web.build=true package \
&& cp "$(find target -maxdepth 1 -type f -name 'solon-claw-*.jar' ! -name 'original-*' | head -n 1)" /tmp/solon-claw.jar
FROM eclipse-temurin:17-jdk
WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8 \
TZ=Asia/Shanghai \
PYTHONIOENCODING=UTF-8 \
PIP_DISABLE_PIP_VERSION_CHECK=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
git \
curl \
wget \
jq \
less \
nano \
vim-tiny \
procps \
psmisc \
net-tools \
iputils-ping \
dnsutils \
file \
tree \
unzip \
zip \
ca-certificates \
tzdata \
locales \
gosu \
tini \
fontconfig \
python3 \
python3-pip \
python3-venv \
nodejs \
npm \
fonts-arphic-gbsn00lp \
fonts-noto-cjk \
&& locale-gen C.UTF-8 \
&& fc-cache -f \
&& update-ca-certificates \
&& ln -sf /usr/bin/python3 /usr/local/bin/python \
&& ln -sf /usr/bin/pip3 /usr/local/bin/pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /tmp/solon-claw.jar /app/solon-claw.jar
COPY docker/entrypoint.sh /app/docker-entrypoint.sh
RUN groupadd -g 10000 solonclaw \
&& useradd -u 10000 -g solonclaw -m -d /home/solonclaw solonclaw \
&& mkdir -p /app/runtime \
&& sed -i 's/\r$//' /app/docker-entrypoint.sh \
&& chmod 755 /app/docker-entrypoint.sh \
&& chmod -R a+rX /app \
&& chown -R solonclaw:solonclaw /app/runtime
EXPOSE 8080
ENTRYPOINT ["/usr/bin/tini", "-g", "--", "/app/docker-entrypoint.sh"]