fix(docker): create .env file in Dockerfile instead of copying

- Create .env file with RUN echo instead of COPY

- .env is in .gitignore so cannot be copied
This commit is contained in:
Ashwin Kumar 2026-04-10 19:37:19 +02:00
parent f1e68632ad
commit 163ebda586
2 changed files with 8 additions and 7 deletions

View file

@ -7,17 +7,16 @@ 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
# Set API URLs for build (create .env file)
RUN echo "VITE_API_URL=http://localhost:9100" > .env && \
echo "PUBLIC_API_URL=http://localhost:9100/api" >> .env && \
echo "VITE_RUST_API_URL=http://localhost:9100/api" >> .env
# 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

View file

@ -30,8 +30,8 @@ vinxi starting dev server
6:17:06 PM [vite] (ssr) page reload Dockerfile
6:17:27 PM [vite] (ssr) page reload Dockerfile
6:18:12 PM [vite] (ssr) page reload Dockerfile
odpecker.yml
5:26:46 AM [vite] (ssr) page reload .woodpecker.yml
7:37:02 PM [vite] (ssr) page reload Dockerfile
d .woodpecker.yml
5:26:46 AM [vite] (client) page reload .woodpecker.yml
5:33:56 AM [vite] (ssr) page reload .woodpecker.yml
5:33:56 AM [vite] (client) page reload .woodpecker.yml
@ -61,3 +61,5 @@ odpecker.yml
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
7:37:02 PM [vite] (ssr) page reload Dockerfile
7:37:02 PM [vite] (client) page reload Dockerfile