PVPPRO commited on
Commit
7d77bcc
·
verified ·
1 Parent(s): 11355a1

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. Use Node.js 20 (Alpine for a smaller, faster image)
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 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"]