Update Dockerfile
Browse files- Dockerfile +9 -14
Dockerfile
CHANGED
|
@@ -1,32 +1,27 @@
|
|
| 1 |
-
#
|
| 2 |
FROM node:20-alpine
|
| 3 |
|
| 4 |
-
#
|
| 5 |
RUN npm install -g pnpm
|
| 6 |
|
| 7 |
-
# 3. Set the working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
#
|
| 11 |
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
|
| 12 |
COPY tsconfig.json tsconfig.base.json ./
|
| 13 |
|
| 14 |
-
#
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
-
#
|
| 18 |
RUN pnpm install --frozen-lockfile
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
# This runs 'tsc --build' which builds lib/db, lib/api-zod, etc. in order
|
| 22 |
-
RUN pnpm run typecheck:libs
|
| 23 |
-
|
| 24 |
-
# 8. Now build the rest of the project
|
| 25 |
RUN pnpm run build
|
| 26 |
|
| 27 |
-
#
|
| 28 |
ENV PORT=7860
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
-
#
|
| 32 |
-
CMD ["pnpm", "start"]
|
|
|
|
| 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 rest of the project
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
+
# Install dependencies
|
| 17 |
RUN pnpm install --frozen-lockfile
|
| 18 |
|
| 19 |
+
# Build the libraries and then the apps
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
RUN pnpm run build
|
| 21 |
|
| 22 |
+
# Set the Hugging Face mandatory port
|
| 23 |
ENV PORT=7860
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# Start the multiplayer server
|
| 27 |
+
CMD ["pnpm", "run", "start"]
|