Skip to content

Commit

Permalink
feat: add dockerfile deployment for bff and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Apoorva64 committed Sep 16, 2024
1 parent 9ee9aa0 commit 1305f24
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 2 deletions.
4 changes: 4 additions & 0 deletions apps/frontend-bff/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM docker.io/nginx:stable-alpine
COPY dist/apps/sample-react/ /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
39 changes: 38 additions & 1 deletion apps/frontend-bff/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,42 @@
"projectType": "application",
"tags": [],
"// targets": "to see all targets run: nx show project frontend-bff --web",
"targets": {}
"targets": {
"container": {
"executor": "@nx-tools/nx-container:build",
"dependsOn": [
"build"
],
"options": {
"engine": "docker",
"push": true,
"platforms": [
"linux/amd64",
"linux/arm64"
],
"metadata": {
"images": [
"ghcr.io/startupnationlabs/spos/frontend-bff"
],
"tags": [
"type=schedule",
"type=ref,event=branch",
"type=ref,event=tag",
"type=ref,event=pr",
"type=sha,prefix=sha-"
]
}
}
},
"tag-docker": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/frontend-bff",
"commands": [
"docker buildx imagetools create -t ghcr.io/startupnationlabs/spos/frontend-bff:$(npm pkg get version --workspaces=false | jq --raw-output '.') ghcr.io/startupnationlabs/spos/frontend-bff:$(git rev-parse --abbrev-ref HEAD)"
],
"parallel": false
}
}
}
}
4 changes: 4 additions & 0 deletions apps/frontend-workflow/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM docker.io/nginx:stable-alpine
COPY dist/apps/sample-react/ /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
39 changes: 38 additions & 1 deletion apps/frontend-workflow/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,42 @@
"projectType": "application",
"tags": [],
"// targets": "to see all targets run: nx show project frontend-workflow --web",
"targets": {}
"targets": {
"container": {
"executor": "@nx-tools/nx-container:build",
"dependsOn": [
"build"
],
"options": {
"engine": "docker",
"push": true,
"platforms": [
"linux/amd64",
"linux/arm64"
],
"metadata": {
"images": [
"ghcr.io/startupnationlabs/spos/frontend-workflow"
],
"tags": [
"type=schedule",
"type=ref,event=branch",
"type=ref,event=tag",
"type=ref,event=pr",
"type=sha,prefix=sha-"
]
}
}
},
"tag-docker": {
"executor": "nx:run-commands",
"options": {
"cwd": "apps/frontend-workflow",
"commands": [
"docker buildx imagetools create -t ghcr.io/startupnationlabs/spos/frontend-workflow:$(npm pkg get version --workspaces=false | jq --raw-output '.') ghcr.io/startupnationlabs/spos/frontend-workflow:$(git rev-parse --abbrev-ref HEAD)"
],
"parallel": false
}
}
}
}

0 comments on commit 1305f24

Please sign in to comment.