Skip to content

Commit

Permalink
feat: adding new dockerfiles for preview environment and relevant cha…
Browse files Browse the repository at this point in the history
…nges
  • Loading branch information
codechirag123 committed Dec 13, 2024
1 parent 8eddba3 commit 8657803
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-preview-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
image_name: workflows-service
ref: ${{ needs.deploy-dev-pr-environment.outputs.ref }}
tag: ${{ needs.deploy-dev-pr-environment.outputs.env_name }}
file: 'Dockerfile'

build-backoffice:
needs: [deploy-dev-pr-environment,build-wf-service]
Expand All @@ -76,6 +77,7 @@ jobs:
image_name: backoffice
ref: ${{ needs.deploy-dev-pr-environment.outputs.ref }}
tag: ${{ needs.deploy-dev-pr-environment.outputs.env_name }}
file: 'Dockerfile.preview'

build-kyb:
needs: [deploy-dev-pr-environment,build-backoffice]
Expand All @@ -86,6 +88,7 @@ jobs:
image_name: kyb-app
ref: ${{ needs.deploy-dev-pr-environment.outputs.ref }}
tag: ${{ needs.deploy-dev-pr-environment.outputs.env_name }}
file: 'Dockerfile.preview'

build-dashboard:
needs: [deploy-dev-pr-environment,build-kyb]
Expand All @@ -96,6 +99,7 @@ jobs:
image_name: workflows-dashboard
ref: ${{ needs.deploy-dev-pr-environment.outputs.ref }}
tag: ${{ needs.deploy-dev-pr-environment.outputs.env_name }}
file: 'Dockerfile.preview'

deploy-preview:
needs: [deploy-dev-pr-environment,build-wf-service,build-backoffice,build-kyb,build-dashboard]
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-push-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
required: true
description: "Tag name of the Preview Image"
type: string
file:
required: true
description: "File name for the Preview Image"
type: string

permissions:
id-token: write
Expand Down Expand Up @@ -116,6 +120,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: ${{ steps.docker_meta.outputs.tags }}
file: ${{ inputs.file }}
build-args: |
${{ inputs.image_name == 'workflows-service' && format('"RELEASE={0}"\n"SHORT_SHA={1}"', steps.version.outputs.tag, steps.version.outputs.sha_short) || '' }}
Expand Down
17 changes: 17 additions & 0 deletions apps/backoffice-v2/Dockerfile.preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:18.17.1-bullseye-slim

WORKDIR /app

COPY ./package.json .

RUN npm install --legacy-peer-deps

COPY . .

RUN npm run build --verbose

ENV PATH="$PATH:/app/node_modules/.bin"

EXPOSE 5137

CMD ["npm", "run", "prod:next", "--host"]
1 change: 1 addition & 0 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"start": "vite",
"dev": "vite",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=32768 vite build",
"prod:next": "vite build && vite",
"test": "vitest run --passWithNoTests",
"test:unit": "vitest run --passWithNoTests",
"test:e2e": "playwright test",
Expand Down
17 changes: 17 additions & 0 deletions apps/kyb-app/Dockerfile.preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:18.17.1-bullseye-slim

WORKDIR /app

COPY ./package.json .

RUN npm install --legacy-peer-deps

COPY . .

RUN npm run build --verbose

ENV PATH="$PATH:./node_modules/.bin"

EXPOSE 5201

CMD ["npm", "run", "prod:next", "--host"]
1 change: 1 addition & 0 deletions apps/kyb-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vite",
"start": "vite",
"build": "tsc && vite build",
"prod:next": "vite build && vite",
"lint": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
Expand Down
17 changes: 17 additions & 0 deletions apps/workflows-dashboard/Dockerfile.preview
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:18.17.1-bullseye-slim

WORKDIR /app

COPY ./package.json .

RUN npm install --legacy-peer-deps

COPY . .

RUN npm run build --verbose

ENV PATH="$PATH:/app/node_modules/.bin"

EXPOSE 5200

CMD ["npm", "run", "prod:next", "--host"]
1 change: 1 addition & 0 deletions apps/workflows-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dev": "vite --host",
"start": "vite",
"build": "tsc && vite build",
"prod:next": "vite build && vite",
"lint": "eslint . --fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
Expand Down

0 comments on commit 8657803

Please sign in to comment.