Skip to content

Commit

Permalink
Merge pull request #307 from UoaWDCC/build-secrets
Browse files Browse the repository at this point in the history
Build secrets
  • Loading branch information
Bobsters6666 authored Oct 9, 2024
2 parents 56f4e44 + 0ee356f commit 0da3006
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
19 changes: 19 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 1 addition & 12 deletions web/Dockerfile.staging
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0da3006

Please sign in to comment.