Skip to content

Commit

Permalink
Merge pull request #1316 from IntersectMBO/feat/deploy-storybook
Browse files Browse the repository at this point in the history
Setup deployment of storybook
  • Loading branch information
mesudip authored Jun 19, 2024
2 parents 0b41db6 + b6d611c commit 85d2f28
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
28 changes: 28 additions & 0 deletions govtool/frontend/storybook.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:18-alpine as deps
ARG NPMRC_TOKEN

WORKDIR /src

# Set npm configuration settings using environment variables
RUN npm config set @intersect.mbo:registry "https://registry.npmjs.org/" --location=global \
&& npm config set //registry.npmjs.org/:_authToken ${NPMRC_TOKEN} --location=global

COPY package.json package-lock.json ./
RUN npm install

FROM node:18-alpine as builder
ARG NPMRC_TOKEN
ENV NODE_OPTIONS=--max_old_space_size=8192
WORKDIR /src

COPY --from=deps /src/node_modules ./node_modules
COPY . .

RUN npm run build-storybook --quiet

FROM nginx:stable-alpine
EXPOSE 80

COPY --from=builder /src/storybook-static /usr/share/nginx/html

CMD ["nginx", "-g", "daemon off;"]
1 change: 1 addition & 0 deletions tests/test-infrastructure/build-and-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ then
update-service govtool_backend "$BASE_IMAGE_NAME"/backend:${GOVTOOL_TAG}
update-service govtool_frontend "$BASE_IMAGE_NAME"/frontend:${GOVTOOL_TAG}
update-service govtool_metadata-validation "$BASE_IMAGE_NAME"/metadata-validation:${GOVTOOL_TAG}
update-service govtool_storybook "$BASE_IMAGE_NAME"/storybook:${GOVTOOL_TAG}

update-service govaction-loader_backend "$BASE_IMAGE_NAME"/gov-action-loader-backend:${GOVTOOL_TAG}
update-service govaction-loader_frontend "$BASE_IMAGE_NAME"/gov-action-loader-frontend:${GOVTOOL_TAG}
Expand Down
17 changes: 16 additions & 1 deletion tests/test-infrastructure/docker-compose-govtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ services:
context: ../../govtool/metadata-validation
environment:
VIRTUAL_HOST: https://${BASE_DOMAIN}/metadata-validation/ -> :3000
PORT: '3000'
PORT: "3000"
networks:
- frontend
deploy:
Expand All @@ -70,3 +70,18 @@ services:
placement:
constraints:
- node.labels.govtool==true
storybook:
image: govtool/storybook:${GOVTOOL_TAG}
build:
context: ../../govtool/frontend
dockerfile: storybook.Dockerfile
args:
NPMRC_TOKEN: ${NPMRC_TOKEN}
environment:
VIRTUAL_HOST: https://storybook-${BASE_DOMAIN}
deploy:
restart_policy:
delay: "30s"
placement:
constraints:
- node.labels.govtool==true

0 comments on commit 85d2f28

Please sign in to comment.