修正构建文件
parent
1987afeb10
commit
c2a2307b34
|
|
@ -103,7 +103,9 @@ services:
|
|||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost/api}
|
||||
# Don't set VITE_API_BASE_URL to use relative path /api (recommended)
|
||||
# This allows the frontend to work with any domain/IP
|
||||
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-}
|
||||
container_name: cosmo_frontend
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
|
|
|
|||
|
|
@ -17,8 +17,9 @@ RUN npm install
|
|||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build argument for API URL
|
||||
ARG VITE_API_BASE_URL=http://localhost/api
|
||||
# Build argument for API URL (optional)
|
||||
# If not set, frontend will use relative path /api (recommended for production)
|
||||
ARG VITE_API_BASE_URL
|
||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||
|
||||
# Build the application (skip TypeScript check for faster builds)
|
||||
|
|
|
|||
Loading…
Reference in New Issue