Files
tankwar_proj/server/Dockerfile
2026-05-02 13:50:52 +08:00

25 lines
527 B
Docker

FROM node:18-alpine
LABEL maintainer="tankwar" \
description="Tank War PVP WebSocket Server"
WORKDIR /app
# Install dependencies first (leverage Docker layer cache)
COPY package.json package-lock.json* ./
RUN npm install --omit=dev --no-audit --no-fund \
&& npm cache clean --force
# Copy the rest of the source
COPY . .
ENV NODE_ENV=production \
HOST=0.0.0.0 \
PORT=3000
EXPOSE 3000
# Graceful shutdown & init for PID 1
RUN apk add --no-cache tini
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "index.js"]