Pass VITE_API_URL as build arg
This commit is contained in:
+3
-1
@@ -3,11 +3,13 @@ FROM node:20-alpine AS builder
|
|||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
|
ARG VITE_API_URL=/api
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN VITE_API_URL=$VITE_API_URL npm run build
|
||||||
|
|
||||||
# Stage 2: App only (no MariaDB)
|
# Stage 2: App only (no MariaDB)
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
|
|||||||
+4
-1
@@ -20,7 +20,10 @@ services:
|
|||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
- VITE_API_URL=/api
|
||||||
ports:
|
ports:
|
||||||
- "8077:80"
|
- "8077:80"
|
||||||
- "4000:4000"
|
- "4000:4000"
|
||||||
|
|||||||
Reference in New Issue
Block a user