Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (36 loc) · 1.5 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (36 loc) · 1.5 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
FROM node:22-trixie-slim
ARG UPSTREAM_VERSION
ARG TARGETARCH
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates ffmpeg libatomic1 libvulkan1 mesa-vulkan-drivers tini vulkan-tools \
&& rm -rf /var/lib/apt/lists/* \
&& npm install --global --no-audit --no-fund "@qvac/cli@${UPSTREAM_VERSION}" \
&& chmod 0755 /usr/local/lib/node_modules/@qvac/cli/node_modules/bare-runtime-*/bin/bare \
&& case "${TARGETARCH}" in \
amd64) qvac_platform=linux-x64 ;; \
arm64) qvac_platform=linux-arm64 ;; \
*) echo "Unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
esac \
&& export qvac_platform \
&& find /usr/local/lib/node_modules/@qvac/cli/node_modules -type d -name prebuilds \
| while IFS= read -r qvac_prebuilds; do \
find "${qvac_prebuilds}" -mindepth 1 -maxdepth 1 -type d \
! -name "${qvac_platform}" ! -name include ! -name share -exec rm -rf {} +; \
done \
&& npm cache clean --force
WORKDIR /app
COPY qvac.config.mjs /app/qvac.config.mjs
COPY manager.mjs /app/manager.mjs
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY ui /app/ui
COPY avatar.png /app/ui/avatar.png
RUN mkdir -p /data/config /data/models /data/runtime \
&& chown -R node:node /app /data \
&& chmod 0755 /usr/local/bin/entrypoint.sh
ENV HOME=/data \
NODE_ENV=production \
QVAC_VERSION=${UPSTREAM_VERSION}
EXPOSE 8080 11434
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["node", "/app/manager.mjs"]