30 lines
996 B
Plaintext
30 lines
996 B
Plaintext
# 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"]
|