From 928b27a177a0a62a7235f58f55052f2e0e95ceb2 Mon Sep 17 00:00:00 2001 From: Jason <79180247+Bobsters6666@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:19:29 +1300 Subject: [PATCH 1/2] build secrets in api dockerfile --- api/Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/api/Dockerfile b/api/Dockerfile index 20434e0..4b56ef3 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -12,6 +12,25 @@ WORKDIR /app ARG YARN_VERSION=1.22.19 RUN npm install -g yarn@$YARN_VERSION --force +# Define arguments for build time +ARG apiKey +ARG authDomai +ARG projectId +ARG storageBucket +ARG messagingSenderId +ARG appId +ARG measurementId +ARG credentials_base64 + +# Set build time environment variables +ENV apiKey=${apiKey} +ENV authDomai=${authDomai} +ENV projectId=${projectId} +ENV storageBucket=${storageBucket} +ENV messagingSenderId=${messagingSenderId} +ENV appId=${appId} +ENV measurementId=${measurementId} +ENV credentials_base64=${credentials_base64} # Throw-away build stage to reduce size of final image FROM base as install From 0ee356f361a15d7c5b2f1cf5dcec99c948b31be0 Mon Sep 17 00:00:00 2001 From: Jason <79180247+Bobsters6666@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:19:47 +1300 Subject: [PATCH 2/2] removed unused build secrets in web --- web/Dockerfile.staging | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/web/Dockerfile.staging b/web/Dockerfile.staging index 6d0f0ef..e51aaaf 100644 --- a/web/Dockerfile.staging +++ b/web/Dockerfile.staging @@ -28,18 +28,7 @@ RUN yarn install --frozen-lockfile --production=false COPY --link . . # Set build time environment variables -ENV VITE_API_URL="https://wdcc-volunteers-api-staging.fly.dev" - -ENV apiKey = ${apiKey} -ENV authDomain = ${authDomain} -ENV projectId = ${projectId} -ENV storageBucket = ${storageBucket} -ENV messagingSenderId = ${messagingSenderId} -ENV appId = ${appId} -ENV measurementId = ${measurementId} - -ENV credentials_base64 = ${credentials_base64} - +ENV VITE_API_URL="https://wdcc-volunteers-api.fly.dev" # Build application RUN yarn run build