Pass VITE_API_URL as build arg

This commit is contained in:
2026-04-24 19:13:47 -03:00
parent e35f67ba6f
commit 1fc2c0fcc1
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -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
View File
@@ -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"