开始多平台 多店铺整改
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{$APP_DOMAIN:localhost} {
|
||||
{$CADDY_SITE_ADDR:http://localhost} {
|
||||
route {
|
||||
handle /api/* {
|
||||
reverse_proxy backend:3000
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{$CADDY_SITE_ADDR:http://localhost} {
|
||||
route {
|
||||
handle /api/* {
|
||||
reverse_proxy backend:3000
|
||||
}
|
||||
|
||||
handle /health {
|
||||
reverse_proxy backend:3000
|
||||
}
|
||||
|
||||
handle {
|
||||
reverse_proxy frontend:5173
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,8 @@ ARG NPM_REGISTRY=https://registry.npmmirror.com
|
||||
ARG UV_INDEX_URL=https://mirrors.cloud.tencent.com/pypi/simple
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
||||
ENV UV_LINK_MODE=copy
|
||||
ENV UV_INDEX_URL=${UV_INDEX_URL}
|
||||
ENV PIP_INDEX_URL=${UV_INDEX_URL}
|
||||
ENV NPM_CONFIG_REGISTRY=${NPM_REGISTRY}
|
||||
|
||||
@@ -17,20 +16,18 @@ RUN sed -i "s|http://deb.debian.org/debian|https://${DEBIAN_MIRROR}/debian|g" /e
|
||||
&& 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 \
|
||||
&& apt-get install -y --no-install-recommends curl ca-certificates python3 python3-pip \
|
||||
&& apt-get install -y --no-install-recommends curl ca-certificates python3 python3-pip tzdata \
|
||||
&& ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
&& echo ${TZ} > /etc/timezone \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN python3 -m pip install --no-cache-dir --break-system-packages uv \
|
||||
&& ln -sf /usr/local/bin/uv /usr/bin/uv
|
||||
|
||||
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
|
||||
|
||||
COPY apps/backend/subservices/ocr-worker/ ./subservices/ocr-worker/
|
||||
RUN --mount=type=cache,target=/root/.cache/uv rm -f subservices/ocr-worker/uv.lock \
|
||||
&& uv sync --directory subservices/ocr-worker
|
||||
RUN python3 -m pip install --no-cache-dir --break-system-packages ./subservices/ocr-worker
|
||||
|
||||
COPY apps/backend/ ./
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
FROM caddy:2-alpine
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
RUN apk add --no-cache tzdata \
|
||||
&& ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
&& echo ${TZ} > /etc/timezone
|
||||
@@ -2,6 +2,7 @@ FROM node:22-bookworm AS builder
|
||||
|
||||
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV NPM_CONFIG_REGISTRY=${NPM_REGISTRY}
|
||||
|
||||
WORKDIR /app
|
||||
@@ -14,5 +15,11 @@ RUN npm run build
|
||||
|
||||
FROM caddy:2-alpine
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
RUN apk add --no-cache tzdata \
|
||||
&& ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
&& echo ${TZ} > /etc/timezone
|
||||
|
||||
COPY deploy/caddy/Caddyfile /etc/caddy/Caddyfile
|
||||
COPY --from=builder /app/dist /srv
|
||||
|
||||
Reference in New Issue
Block a user