Skip to content

Commit

Permalink
chore(server): build prod Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
sripwoud committed Sep 9, 2024
1 parent 00f8262 commit 06b277b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 23 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
18 changes: 11 additions & 7 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ FROM node:20-alpine as base
RUN apk update && apk upgrade && apk add dumb-init && apk add --no-cache bash
WORKDIR app

COPY *.json .
FROM base as build
COPY *.json ./
COPY src ./src
RUN npm i -g pnpm &&\
pnpm i &&\
pnpm tsc &&\
rm -fr node_modules &&\
pnpm i --prod

RUN npm i -g pnpm && pnpm i

EXPOSE 3000
FROM base as release
COPY --from=build /app/dist ./dist
COPY --from=build /app/node_modules ./node_modules
EXPOSE 3001
ENV NODE_ENV=production

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["pnpm", "dev"]
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@types/node-forge": "^1.3.11",
"@types/pkijs": "^3.0.1",
"@types/snarkjs": "^0.7.8",
"ts-node": "^10.9.2"
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
}
}
13 changes: 0 additions & 13 deletions server/render.yaml

This file was deleted.

5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ client@client:
easyqrcodejs "^4.6.1"
js-cookie "^3.0.5"
lottie-react "^2.4.0"
million ""
million "^3.1.11"
next "14.2.8"
react "^18"
react-dom "^18"
Expand Down Expand Up @@ -2293,6 +2293,7 @@ server@server:
"@types/pkijs" "^3.0.1"
"@types/snarkjs" "^0.7.8"
ts-node "^10.9.2"
typescript ""
dependencies:
asn1js "^3.0.5"
cors "^2.8.5"
Expand Down Expand Up @@ -2626,7 +2627,7 @@ type-is@~1.6.18:
mime-types "~2.1.24"
media-typer "0.3.0"

typescript@>=2.7, typescript@>=3, typescript@^5, typescript@^5.2.2:
typescript@>=2.7, typescript@>=3, typescript@^5, typescript@^5.2.2, typescript@^5.5.4:
version "5.5.4"
resolved "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz"
integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==
Expand Down

0 comments on commit 06b277b

Please sign in to comment.