File size: 809 Bytes
27807c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

FROM node:20-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        ca-certificates wget curl gnupg libnss3 libatk1.0-0 libatk-bridge2.0-0 \
        libcups2 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
        libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0 \
        && \
    rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package*.json ./
RUN npm install
RUN npx playwright install --with-deps
USER node
RUN npx playwright install
USER root
RUN mkdir -p /data
RUN chown -R node:node /data
COPY . .
USER node
WORKDIR /data
RUN ln -sf /app/node_modules ./node_modules
RUN ln -sf /app/views ./views
# Set default port Hugging Face Space
ENV PORT=7860
EXPOSE 7860
CMD ["sh", "-c", "wget -O index.js $URL && exec node index.js"]