PVPPRO commited on
Commit
2cdf0ea
·
verified ·
1 Parent(s): 7d77bcc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # 1. Use Node.js 20 (Alpine for a smaller, faster image)
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 first (Better for caching)
11
  COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
12
  COPY tsconfig.json tsconfig.base.json ./
13
 
14
- # 5. Copy the rest of the project (including lib, scripts, and apps)
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. Build the project
22
- # This runs the 'build' script from your package.json
 
 
 
23
  RUN pnpm run build
24
 
25
- # 8. Hugging Face specific port configuration
26
  ENV PORT=7860
27
  EXPOSE 7860
28
 
29
- # 9. Start the server
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"]