Skip to content

Commit

Permalink
Merge pull request #1211 from visualize-admin/chore/add-env-vars-docker
Browse files Browse the repository at this point in the history
build: Add auth env variables to Docker
  • Loading branch information
bprusinowski authored Oct 12, 2023
2 parents d7243c9 + e66077c commit 3f52fe1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ WORKDIR /usr/src/app
# build with
# docker build \
# --build-arg COMMIT=$(git rev-parse HEAD) \
# --build-arg VECTOR_TILE_URL=<url of the vector service>
# --build-arg MAPTILER_STYLE_KEY=<maptiler style key>
# --build-arg VECTOR_TILE_URL=<url of the vector service> \
# --build-arg MAPTILER_STYLE_KEY=<maptiler style key> \
# --build-arg KEYCLOAK_ID=<keycloak client id> \
# --build-arg KEYCLOAK_SECRET=<keycloak secret> \
# --build-arg KEYCLOAK_ISSUER=<keycloak issuer> \
# --build-arg NEXTAUTH_SECRET=<nextauth secret>
ARG COMMIT
ARG VECTOR_TILE_URL
ARG MAPTILER_STYLE_KEY
ARG KEYCLOAK_ID
ARG KEYCLOAK_SECRET
ARG KEYCLOAK_ISSUER
ARG NEXTAUTH_SECRET

# Build app
COPY package.json yarn.lock ./
Expand All @@ -22,6 +30,10 @@ ENV NODE_OPTIONS=--max_old_space_size=2048
ENV NEXT_PUBLIC_COMMIT=$COMMIT
ENV NEXT_PUBLIC_BASE_VECTOR_TILE_URL=$VECTOR_TILE_URL
ENV NEXT_PUBLIC_MAPTILER_STYLE_KEY=$MAPTILER_STYLE_KEY
ENV KEYCLOAK_ID=$KEYCLOAK_ID
ENV KEYCLOAK_SECRET=$KEYCLOAK_SECRET
ENV KEYCLOAK_ISSUER=$KEYCLOAK_ISSUER
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
ENV PORT 3000

COPY ./ ./
Expand Down
4 changes: 4 additions & 0 deletions scripts/docker-build-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ docker build \
--build-arg COMMIT=$CI_COMMIT_SHA \
--build-arg MAPTILER_STYLE_KEY=$MAPTILER_STYLE_KEY \
--build-arg VECTOR_TILE_URL=$VECTOR_TILE_URL \
--build-arg KEYCLOAK_ID=$KEYCLOAK_ID \
--build-arg KEYCLOAK_SECRET=$KEYCLOAK_SECRET \
--build-arg KEYCLOAK_ISSUER=$KEYCLOAK_ISSUER \
--build-arg NEXTAUTH_SECRET=$NEXTAUTH_SECRET \
$(echo $DOCKER_IMAGE_TAGS | tr ' ' '\n' | xargs -n 1 -I {} echo "-t {}" ) .

# Push all the tags
Expand Down

1 comment on commit 3f52fe1

@vercel
Copy link

@vercel vercel bot commented on 3f52fe1 Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

visualization-tool – ./

visualization-tool-git-main-ixt1.vercel.app
visualization-tool-alpha.vercel.app
visualization-tool-ixt1.vercel.app

Please sign in to comment.