Arkm20 commited on
Commit
f45d4e3
·
verified ·
1 Parent(s): 3a36d47

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -6
Dockerfile CHANGED
@@ -1,18 +1,26 @@
1
  FROM node:18-slim
2
 
3
- # Install Playwright dependencies
4
  RUN apt-get update && apt-get install -y wget ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils
5
 
6
- # Install node modules
 
 
 
7
  WORKDIR /app
 
 
8
  COPY package.json ./
9
  RUN npm install
10
- RUN npx playwright install --with-deps
 
 
 
11
  # Copy app code
12
  COPY . .
13
 
14
- # Expose port (even though we don't need it — HF requires it)
15
  EXPOSE 7860
16
 
17
- # Start script
18
- CMD ["node", "index.js"]
 
1
  FROM node:18-slim
2
 
3
+ # Install system dependencies for Playwright
4
  RUN apt-get update && apt-get install -y wget ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils
5
 
6
+ # Set environment variables so Playwright installs correctly
7
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
8
+
9
+ # Set working directory
10
  WORKDIR /app
11
+
12
+ # Install node modules
13
  COPY package.json ./
14
  RUN npm install
15
+
16
+ # Install Playwright browsers
17
+ RUN npx playwright install chromium
18
+
19
  # Copy app code
20
  COPY . .
21
 
22
+ # Expose port
23
  EXPOSE 7860
24
 
25
+ # Start app
26
+ CMD ["node", "index.js"]