chore: consolidate app compose dev and prod
This commit is contained in:
+7
-2
@@ -1,12 +1,17 @@
|
||||
FROM node:20 AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
# TODO: Remove this or review embedded variables
|
||||
COPY .env .env
|
||||
|
||||
# First generate package-lock.json if it doesn't exist, then do clean install
|
||||
RUN if [ ! -f package-lock.json ]; then npm install --package-lock-only; fi && npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
# Vite bakes VITE_* values at build time, so compose must choose the env file
|
||||
# during image build, not only at container runtime.
|
||||
ARG ENV_FILE=.env
|
||||
COPY ${ENV_FILE} .env
|
||||
|
||||
# Run build with production mode
|
||||
RUN npm run build -- --mode production
|
||||
|
||||
|
||||
Reference in New Issue
Block a user