Skip to content

Commit

Permalink
Migrated from deno-server to using the node-cluster preset becaus…
Browse files Browse the repository at this point in the history
…e deno has weird dependency issues

Related issue denoland/deno#22606
  • Loading branch information
CommanderStorm committed Apr 7, 2024
1 parent 53f078d commit 68418c7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions webclient/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:21 as build-stage
FROM node:21-alpine3.19 as build-stage
WORKDIR /app
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
Expand All @@ -12,19 +12,23 @@ ARG GIT_COMMIT_SHA
ENV GIT_COMMIT_SHA=${GIT_COMMIT_SHA}
ARG GIT_COMMIT_MESSAGE
ENV GIT_COMMIT_MESSAGE=${GIT_COMMIT_MESSAGE}
RUN NITRO_PRESET=deno-server pnpm run build
ENV NITRO_SHUTDOWN=true
ENV NITRO_PRESET=node-cluster
RUN pnpm run build


FROM denoland/deno:alpine as production-stage
FROM node:21-alpine3.19 as production-stage
RUN apk update --no-progress --quiet && apk add curl --no-progress --quiet

COPY --from=build-stage /app/.output /app/.output
COPY --from=build-stage /app/node_modules /app/node_modules
COPY --from=build-stage /app/.nuxt /app/.nuxt

ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000
EXPOSE 3000
ENV NITRO_PORT=3000
ENV NITRO_HOST=0.0.0.0
ENV NITRO_SHUTDOWN=true
ENV NITRO_PRESET=node-cluster

HEALTHCHECK CMD curl --fail localhost:3000/health || exit 1
CMD deno run --unstable --allow-net --allow-read --allow-env /app/.output/server/index.mjs
CMD node /app/.output/server/index.mjs

0 comments on commit 68418c7

Please sign in to comment.