tjo.space/Dockerfile

25 lines
495 B
Docker
Raw Normal View History

2024-04-20 18:18:38 +00:00
FROM node:lts as web
2023-09-11 12:33:16 +00:00
# Reduce npm log spam and colour during install within Docker
ENV NPM_CONFIG_LOGLEVEL=warn
ENV NPM_CONFIG_COLOR=false
2023-09-11 12:02:23 +00:00
2023-09-11 12:33:16 +00:00
WORKDIR /home/node/app
2023-09-11 12:02:23 +00:00
2024-04-20 18:18:38 +00:00
COPY --chown=node:node web /home/node/app/
2023-09-11 12:02:23 +00:00
2023-09-11 12:33:16 +00:00
RUN npm install
RUN npm run typecheck
RUN npm run build
2023-09-11 12:02:23 +00:00
2024-04-20 18:18:38 +00:00
FROM denoland/deno:1.42.3 as build-server
WORKDIR /app
COPY server /app
COPY --from=web /home/node/app/build /app/web
RUN deno cache server.ts
2023-09-11 12:02:23 +00:00
2024-04-20 18:18:38 +00:00
USER deno
CMD ["run", "--unstable-kv", "--allow-net", "--allow-read", "server.ts"]