前端修饰与渲染处理
This commit is contained in:
29
docker/frontend.Dockerfile.dev
Normal file
29
docker/frontend.Dockerfile.dev
Normal file
@@ -0,0 +1,29 @@
|
||||
# Frontend Development Dockerfile - Vue3 + Vite (No Nginx)
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files and npm config
|
||||
COPY client/package*.json ./client/
|
||||
COPY client/.npmrc ./client/
|
||||
COPY shared/package*.json ./shared/
|
||||
|
||||
# Install dependencies with multiple mirror fallback
|
||||
RUN cd client && \
|
||||
echo "Trying Aliyun mirror for frontend..." && \
|
||||
npm install --registry=https://registry.npmmirror.com --prefer-offline --no-audit --no-fund || \
|
||||
(echo "Aliyun failed, trying Tencent Cloud..." && \
|
||||
npm install --registry=https://mirrors.cloud.tencent.com/npm/ --prefer-offline --no-audit --no-fund) || \
|
||||
(echo "Tencent failed, trying Huawei Cloud..." && \
|
||||
npm install --registry=https://repo.huaweicloud.com/repository/npm/ --prefer-offline --no-audit --no-fund)
|
||||
|
||||
# Copy source code
|
||||
COPY client ./client
|
||||
COPY shared ./shared
|
||||
|
||||
# Expose Vite dev server port
|
||||
EXPOSE 5173
|
||||
|
||||
# Start Vite dev server
|
||||
WORKDIR /app/client
|
||||
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
|
||||
Reference in New Issue
Block a user