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:27 +02:00
parent 2042003949
commit addd36a869

View file

@ -7,15 +7,14 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ENV CYPRESS_INSTALL_BINARY=0 ENV CYPRESS_INSTALL_BINARY=0
ENV NODE_ENV=production ENV NODE_ENV=production
# Set API URL for build # Set API URL for build (create .env file)
ENV GATEWAY_URL=http://localhost:9100 RUN echo "GATEWAY_URL=http://localhost:9100" > .env
# Install build dependencies # Install build dependencies
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
# Copy package files # Copy package files
COPY package*.json ./ COPY package*.json ./
COPY .env ./
# Install dependencies # Install dependencies
RUN npm ci --legacy-peer-deps --prefer-offline --no-audit RUN npm ci --legacy-peer-deps --prefer-offline --no-audit