# 1. Use Node.js 20 FROM node:20-alpine # 2. Install pnpm globally RUN npm install -g pnpm # 3. Set the working directory WORKDIR /app # 4. Copy configuration files COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./ COPY tsconfig.json tsconfig.base.json ./ # 5. Copy the entire project COPY . . # 6. Install dependencies with platform-specific fix # This tells pnpm to specifically fetch the Linux binaries needed for Rollup/Vite RUN pnpm config set supported-architectures ["linux-x64-musl"] RUN pnpm install # 7. Build the libraries and then the apps RUN pnpm run build # 8. Hugging Face port configuration ENV PORT=7860 EXPOSE 7860 # 9. Start the multiplayer server CMD ["pnpm", "run", "start"]