54
loading...
This website collects cookies to deliver better user experience
dotenv
package, despite what articles tell you:environment.prod.json
and environment.json
in your src/environments
folder# Config Files
/src/environments/*.json
environment.ts
filesimport * as firebase_env from './environment.prod.json';
export const environment = {
production: true,
firebase: firebase_env
};
environment.prod.json
file(s).{
"key": "value",
...
}
tsconfig.json
and add{
"compilerOptions": {
...
"resolveJsonModule": true,
...
}
main
branch to master
depending on your setup.cloudbuild.yaml
, but you don't have to. It is done automatically for you once you connect your repository.Open Editor
button.build-arg
to the build step like so:steps:
- name: gcr.io/cloud-builders/docker
args:
- build
- '--build-arg'
- _FIREBASE=$_FIREBASE
- '--no-cache'
- '-t'
- '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
- .
- '-f'
- Dockerfile
id: Build
_FIREBASE
variable which will be passed to the docker file.timeout: 1600s
to the bottom of the file if you believe the build will take more than 10 minutes. Angular Builds can take a while due to all the optimizations etc.FROM node:14-slim
ARG _FIREBASE
WORKDIR /usr/src/app
COPY . .
RUN npm i
RUN npm audit fix
RUN echo "$_FIREBASE" >> src/environments/environment.prod.json
RUN npm run build:ssr
CMD ["npm", "run", "serve:ssr"]
ARG
for this to work. You can do any variables you like.More Sveltekit and Vercel Sharing Varaibles
More Angular Universal setup