Skip to content

Commit

Permalink
Added dockerfile for website, modified taskfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikash authored and Bikash committed Dec 21, 2023
1 parent ff74a4a commit cc99509
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions Dockerfile.website
Original file line number Diff line number Diff line change
@@ -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
11 changes: 10 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tasks:
case $(whoami) in
"bikash")
URL_SUFFIX=1
URL_SUFFIX=""
;;
"vision")
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down

0 comments on commit cc99509

Please sign in to comment.