Update Dockerfile
Browse files- Dockerfile +12 -9
Dockerfile
CHANGED
|
@@ -1,27 +1,30 @@
|
|
| 1 |
-
# Use Node.js 20
|
| 2 |
FROM node:20-alpine
|
| 3 |
|
| 4 |
-
# Install pnpm
|
| 5 |
RUN npm install -g pnpm
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
# Copy configuration files
|
| 10 |
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
|
| 11 |
COPY tsconfig.json tsconfig.base.json ./
|
| 12 |
|
| 13 |
-
# Copy the
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
-
# Install dependencies
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
# Build the libraries and then the apps
|
| 20 |
RUN pnpm run build
|
| 21 |
|
| 22 |
-
#
|
| 23 |
ENV PORT=7860
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
# Start the multiplayer server
|
| 27 |
CMD ["pnpm", "run", "start"]
|
|
|
|
| 1 |
+
# 1. Use Node.js 20
|
| 2 |
FROM node:20-alpine
|
| 3 |
|
| 4 |
+
# 2. Install pnpm globally
|
| 5 |
RUN npm install -g pnpm
|
| 6 |
|
| 7 |
+
# 3. Set the working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# 4. Copy configuration files
|
| 11 |
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
|
| 12 |
COPY tsconfig.json tsconfig.base.json ./
|
| 13 |
|
| 14 |
+
# 5. Copy the entire project
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
+
# 6. Install dependencies with platform-specific fix
|
| 18 |
+
# This tells pnpm to specifically fetch the Linux binaries needed for Rollup/Vite
|
| 19 |
+
RUN pnpm config set supported-architectures ["linux-x64-musl"]
|
| 20 |
+
RUN pnpm install
|
| 21 |
|
| 22 |
+
# 7. Build the libraries and then the apps
|
| 23 |
RUN pnpm run build
|
| 24 |
|
| 25 |
+
# 8. Hugging Face port configuration
|
| 26 |
ENV PORT=7860
|
| 27 |
EXPOSE 7860
|
| 28 |
|
| 29 |
+
# 9. Start the multiplayer server
|
| 30 |
CMD ["pnpm", "run", "start"]
|