diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-08-25 23:02:27 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-08-25 23:02:27 +0200 |
| commit | baea04f1f4a2070832b85c6b1b61824297493cb7 (patch) | |
| tree | 2a6f8ec3bb009070ea15b392b64b9b6a3cb70c33 /server | |
| parent | 80172072ed99b14e3d5b435b097888a4621f78bc (diff) | |
Add docker container / docker-compose
Diffstat (limited to 'server')
| -rw-r--r-- | server/Dockerfile | 14 | ||||
| -rw-r--r-- | server/index.js | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..25f5853 --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,14 @@ +FROM node:20-alpine AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable +COPY . /app +WORKDIR /app + +FROM base AS dependencies +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile + +FROM base +COPY --from=dependencies /app/node_modules /app/node_modules +EXPOSE 8000 +CMD [ "node", "./index.js" ] diff --git a/server/index.js b/server/index.js index 2508408..56a1df4 100644 --- a/server/index.js +++ b/server/index.js @@ -3,6 +3,7 @@ import { port } from './config.js'; import * as events from './events.js'; const server = new Server(port); +console.log(`Listening on port ${port}`); const sockets = {}; |