diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..910115b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:24-alpine +WORKDIR /app + +# copy whole project, install pnpm, and build +# install pnpm so package manager is consistent +COPY . ./ +RUN npm i pnpm +RUN pnpm i +RUN pnpm build + +EXPOSE 4321 + +# set a user so the container doesnt run as root +RUN useradd app +USER app + +CMD ["node", "./dist/server/entry.mjs"] \ No newline at end of file diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..8b0bef2 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,10 @@ +services: + server: + build: . + ports: + - 80:4321 + env_file: ./.env + volumes: + - type: bind + source: ./.refreshToken + target: /app/.refreshToken \ No newline at end of file