I´m trying to dockerize my Angular application for Cloud Run and then conditionally build it with the production or the development configuration based on an environment variable.
cloud build command:
gcloud builds submit --tag gcr.io/project-id/image-id --timeout=1200
Dockerfile:
FROM node:14
WORKDIR usr/src/app
COPY package*.json ./
RUN npm install
# Copy local code to the container
COPY . .
# Build app
RUN if [ "$ENV" = "development" ] ; then npm run build-dev:ssr ; else npm run build-prod:ssr ; fi
CMD ["npm", "run", "serve:ssr"]
At the moment, the $ENV doesn´t exist, but is there a way to pass this with the gcloud build submit command?