修正构建文件
parent
1987afeb10
commit
c2a2307b34
|
|
@ -103,7 +103,9 @@ services:
|
||||||
context: ./frontend
|
context: ./frontend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
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
|
container_name: cosmo_frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,9 @@ RUN npm install
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build argument for API URL
|
# Build argument for API URL (optional)
|
||||||
ARG VITE_API_BASE_URL=http://localhost/api
|
# 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
|
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||||
|
|
||||||
# Build the application (skip TypeScript check for faster builds)
|
# Build the application (skip TypeScript check for faster builds)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue