From cc99509a3e1252e2c95223c2a2001562b26251fe Mon Sep 17 00:00:00 2001 From: Bikash Date: Thu, 21 Dec 2023 11:50:54 +0530 Subject: [PATCH] Added dockerfile for website, modified taskfile --- .dockerignore | 2 ++ Dockerfile.website | 17 +++++++++++++++++ Taskfile.yaml | 11 ++++++++++- src/design-system/package.json | 2 +- 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Dockerfile.website diff --git a/.dockerignore b/.dockerignore index 6054ff4c2..c5935792a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,3 +18,5 @@ src/generated/node_modules src/generated/plugin/node_modules src/design-system/node_modules +src/apps/devdoc/node_modules +src/apps/devdoc/.next diff --git a/Dockerfile.website b/Dockerfile.website new file mode 100644 index 000000000..5f67f8eec --- /dev/null +++ b/Dockerfile.website @@ -0,0 +1,17 @@ +FROM node:20.8.1-alpine as node +WORKDIR /app + +COPY ./src/apps/devdoc ./src/apps/devdoc +COPY ./src/design-system/tailwind-base.js ./src/design-system/tailwind-base.js +COPY ./src/design-system/css-plugins ./src/design-system/css-plugins +COPY ./src/design-system/css ./src/design-system/css +COPY ./src/design-system/out ./src/design-system/out + +WORKDIR /app/src/apps/devdoc + +RUN npm i -g pnpm +RUN pnpm i -p + +RUN npm run build + +ENTRYPOINT pnpm start \ No newline at end of file diff --git a/Taskfile.yaml b/Taskfile.yaml index b0fb795b8..e3971bb22 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -35,7 +35,7 @@ tasks: case $(whoami) in "bikash") - URL_SUFFIX=1 + URL_SUFFIX="" ;; "vision") @@ -170,3 +170,12 @@ tasks: - docker push {{.IMAGE}}/auth:{{.tag}} - docker build --build-arg APP=console . -t {{.IMAGE}}/console:{{.tag}} - docker push {{.IMAGE}}/console:{{.tag}} + + docker-build-website: + preconditions: + - sh: '[[ -n "{{.tag}}" ]]' + msg: "var tag must have a value" + silent: false + cmds: + - cd ./src/design-system && mkdir -p out && pnpm local:release + - docker buildx build --platform linux/amd64 . -t {{.tag}} -f Dockerfile.website diff --git a/src/design-system/package.json b/src/design-system/package.json index 54a692234..7906afb65 100644 --- a/src/design-system/package.json +++ b/src/design-system/package.json @@ -8,7 +8,7 @@ "author": "", "license": "ISC", "scripts": { - "local:release": "npm run build:css && npm run build && node prod-package.js && cd dist && npm pack --pack-destination ../out", + "local:release": "mkdir -p out && npm run build:css && npm run build && node prod-package.js && cd dist && npm pack --pack-destination ../out", "build": "npm run clean && node build.js && npm run tsc", "clean": "rimraf dist", "tsc": "tsc --emitDeclarationOnly --outDir ./dist/",