1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2026-02-21 07:48:12 +00:00

feat: containerize server with Docker

This commit is contained in:
2026-02-19 13:02:50 +01:00
parent ae7c3a4662
commit 366847e1bd
8 changed files with 75 additions and 5 deletions

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npx tsc
FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/server.js ./
COPY --from=builder /app/common.js ./
EXPOSE 1234
CMD ["node", "server.js"]