优化docker相关
This commit is contained in:
@@ -12,22 +12,27 @@ ENV NPM_CONFIG_REGISTRY=${NPM_REGISTRY}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN sed -i "s|http://deb.debian.org/debian|https://${DEBIAN_MIRROR}/debian|g" /etc/apt/sources.list.d/debian.sources \
|
||||
&& sed -i "s|http://security.debian.org/debian-security|https://${DEBIAN_MIRROR}/debian-security|g" /etc/apt/sources.list.d/debian.sources
|
||||
|
||||
RUN apt-get update \
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
sed -i "s|http://deb.debian.org/debian|https://${DEBIAN_MIRROR}/debian|g" /etc/apt/sources.list.d/debian.sources \
|
||||
&& sed -i "s|http://security.debian.org/debian-security|https://${DEBIAN_MIRROR}/debian-security|g" /etc/apt/sources.list.d/debian.sources \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl ca-certificates python3 python3-pip tzdata xauth x11vnc novnc websockify \
|
||||
&& ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
&& echo ${TZ} > /etc/timezone \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
&& echo ${TZ} > /etc/timezone
|
||||
|
||||
COPY apps/backend/package.json apps/backend/package-lock.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm npm ci
|
||||
|
||||
RUN PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright/ npx playwright install --with-deps chromium
|
||||
RUN --mount=type=cache,target=/ms-playwright-cache,sharing=locked \
|
||||
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright-cache \
|
||||
PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright/ \
|
||||
npx playwright install --with-deps chromium \
|
||||
&& cp -r /ms-playwright-cache /ms-playwright
|
||||
|
||||
COPY apps/backend/subservices/ocr-worker/ ./subservices/ocr-worker/
|
||||
RUN python3 -m pip install --no-cache-dir --break-system-packages ./subservices/ocr-worker
|
||||
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
|
||||
python3 -m pip install --break-system-packages ./subservices/ocr-worker
|
||||
|
||||
COPY apps/backend/ ./
|
||||
|
||||
|
||||
Reference in New Issue
Block a user