fix(docker): add .env file and API URLs for build

- Copy .env file before npm install

- Set VITE_API_URL and PUBLIC_API_URL env vars

- Use npm ci instead of npm install
This commit is contained in:
Ashwin Kumar 2026-04-10 18:18:20 +02:00
parent dc3c53e3e7
commit f1e68632ad
2 changed files with 11 additions and 3 deletions

View file

@ -7,14 +7,20 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ENV CYPRESS_INSTALL_BINARY=0
ENV NODE_ENV=production
# Set API URLs for build
ENV VITE_API_URL=http://localhost:9100
ENV PUBLIC_API_URL=http://localhost:9100/api
ENV VITE_RUST_API_URL=http://localhost:9100/api
# Install build dependencies
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
COPY .env ./
# Install dependencies
RUN npm ci --legacy-peer-deps --prefer-offline --no-audit || npm install --legacy-peer-deps --prefer-offline --no-audit
RUN npm ci --legacy-peer-deps --prefer-offline --no-audit
# Copy source
COPY . .

View file

@ -29,8 +29,8 @@ vinxi starting dev server
6:11:15 PM [vite] (ssr) page reload Dockerfile
6:17:06 PM [vite] (ssr) page reload Dockerfile
6:17:27 PM [vite] (ssr) page reload Dockerfile
.yml
5:23:49 AM [vite] (client) page reload .woodpecker.yml
6:18:12 PM [vite] (ssr) page reload Dockerfile
odpecker.yml
5:26:46 AM [vite] (ssr) page reload .woodpecker.yml
5:26:46 AM [vite] (client) page reload .woodpecker.yml
5:33:56 AM [vite] (ssr) page reload .woodpecker.yml
@ -59,3 +59,5 @@ vinxi starting dev server
6:17:06 PM [vite] (client) page reload Dockerfile
6:17:27 PM [vite] (ssr) page reload Dockerfile
6:17:27 PM [vite] (client) page reload Dockerfile
6:18:12 PM [vite] (ssr) page reload Dockerfile
6:18:12 PM [vite] (client) page reload Dockerfile