feat: vtracer implemented and added docker file binaries install
This commit is contained in:
parent
e78de6f6de
commit
76c840dbaa
2 changed files with 19 additions and 4 deletions
21
Dockerfile
21
Dockerfile
|
|
@ -43,7 +43,7 @@ RUN bun run build
|
||||||
# copy production dependencies and source code into final image
|
# copy production dependencies and source code into final image
|
||||||
FROM base AS release
|
FROM base AS release
|
||||||
|
|
||||||
# install additional dependencies
|
# install additional dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
assimp-utils \
|
assimp-utils \
|
||||||
calibre \
|
calibre \
|
||||||
|
|
@ -75,15 +75,30 @@ RUN apt-get update && apt-get install -y \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install VTracer binary (corrected version using tar.gz)
|
||||||
|
RUN ARCH=$(uname -m) && \
|
||||||
|
if [ "$ARCH" = "aarch64" ]; then \
|
||||||
|
VTRACER_ASSET="vtracer-aarch64-unknown-linux-musl.tar.gz"; \
|
||||||
|
else \
|
||||||
|
VTRACER_ASSET="vtracer-x86_64-unknown-linux-musl.tar.gz"; \
|
||||||
|
fi && \
|
||||||
|
echo "Downloading VTracer: $VTRACER_ASSET" && \
|
||||||
|
curl -L -o /tmp/vtracer.tar.gz "https://github.com/visioncortex/vtracer/releases/download/0.6.4/${VTRACER_ASSET}" && \
|
||||||
|
tar -xzf /tmp/vtracer.tar.gz -C /tmp/ && \
|
||||||
|
mv /tmp/vtracer /usr/local/bin/vtracer && \
|
||||||
|
chmod +x /usr/local/bin/vtracer && \
|
||||||
|
rm /tmp/vtracer.tar.gz && \
|
||||||
|
echo "VTracer installed successfully" && \
|
||||||
|
vtracer --help
|
||||||
|
|
||||||
COPY --from=install /temp/prod/node_modules node_modules
|
COPY --from=install /temp/prod/node_modules node_modules
|
||||||
COPY --from=prerelease /app/public/generated.css /app/public/
|
COPY --from=prerelease /app/public/generated.css /app/public/
|
||||||
COPY --from=prerelease /app/dist /app/dist
|
COPY --from=prerelease /app/dist /app/dist
|
||||||
|
|
||||||
# COPY . .
|
|
||||||
RUN mkdir data
|
RUN mkdir data
|
||||||
|
|
||||||
EXPOSE 3000/tcp
|
EXPOSE 3000/tcp
|
||||||
# used for calibre
|
|
||||||
ENV QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox"
|
ENV QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox"
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENTRYPOINT [ "bun", "run", "dist/src/index.js" ]
|
ENTRYPOINT [ "bun", "run", "dist/src/index.js" ]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ export function convert(
|
||||||
|
|
||||||
execFile("vtracer", args, (error, stdout, stderr) => {
|
execFile("vtracer", args, (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(`error: ${error}`);
|
reject(`error: ${error}${stderr ? `\nstderr: ${stderr}` : ''}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue