Update Dockerfile
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# 1. Use Node.js 20
|
| 2 |
FROM node:20-alpine
|
| 3 |
|
| 4 |
# 2. Install pnpm globally
|
|
@@ -7,26 +7,26 @@ RUN npm install -g pnpm
|
|
| 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
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
# 6. Install dependencies
|
| 18 |
-
# Using --frozen-lockfile ensures it matches your pnpm-lock.yaml exactly
|
| 19 |
RUN pnpm install --frozen-lockfile
|
| 20 |
|
| 21 |
-
# 7.
|
| 22 |
-
# This
|
|
|
|
|
|
|
|
|
|
| 23 |
RUN pnpm run build
|
| 24 |
|
| 25 |
-
#
|
| 26 |
ENV PORT=7860
|
| 27 |
EXPOSE 7860
|
| 28 |
|
| 29 |
-
#
|
| 30 |
-
# Your package.json uses 'pnpm run build' to prepare the workspace
|
| 31 |
-
# Make sure you have a 'start' script in your root package.json
|
| 32 |
CMD ["pnpm", "start"]
|
|
|
|
| 1 |
+
# 1. Use Node.js 20
|
| 2 |
FROM node:20-alpine
|
| 3 |
|
| 4 |
# 2. Install pnpm globally
|
|
|
|
| 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
|
|
|
|
| 18 |
RUN pnpm install --frozen-lockfile
|
| 19 |
|
| 20 |
+
# 7. BUILD LIBRARIES FIRST (This fixes the TS6305 error)
|
| 21 |
+
# This tells pnpm to find all packages in the 'lib' folder and build them
|
| 22 |
+
RUN pnpm -r --filter "./lib/**" run build
|
| 23 |
+
|
| 24 |
+
# 8. Now build the rest of the project
|
| 25 |
RUN pnpm run build
|
| 26 |
|
| 27 |
+
# 9. Hugging Face port configuration
|
| 28 |
ENV PORT=7860
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
+
# 10. Start the server
|
|
|
|
|
|
|
| 32 |
CMD ["pnpm", "start"]
|