hansaka01 commited on
Commit
c965c4f
·
verified ·
1 Parent(s): 6789255

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -20
Dockerfile CHANGED
@@ -1,32 +1,27 @@
1
- FROM node:20-slim
 
2
 
3
- # Install system dependencies for Tesseract OCR and Sharp
4
- RUN apt-get update && apt-get install -y --no-install-recommends \
5
- tesseract-ocr \
6
- tesseract-ocr-eng \
7
- libtesseract-dev \
8
- libgl1-mesa-glx \
9
- libvips42 \
10
- python3 \
11
- python3-pip \
12
- ca-certificates \
13
- && rm -rf /var/lib/apt/lists/*
14
 
15
- # Set up app directory with correct ownership
16
  WORKDIR /home/node/app
17
  RUN chown -R node:node /home/node/app
18
 
 
19
  USER node
20
  ENV HOME=/home/node \
21
- PORT=7860
22
 
23
- # Install Node dependencies first (layer caching)
24
- COPY --chown=node:node package*.json ./
25
- RUN npm install --omit=dev
26
 
27
- # Copy source files
28
- COPY --chown=node:node . .
29
 
 
30
  EXPOSE 7860
31
 
32
- CMD ["node", "bot.js"]
 
 
 
1
+ # Use official Node.js 18 slim image
2
+ FROM node:18-slim
3
 
4
+ # Install git to clone the repository
5
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
 
 
6
 
7
+ # Set the working directory and permissions
8
  WORKDIR /home/node/app
9
  RUN chown -R node:node /home/node/app
10
 
11
+ # Use the existing 'node' user (UID 1000)
12
  USER node
13
  ENV HOME=/home/node \
14
+ PATH=/home/node/.local/bin:$PATH
15
 
16
+ # The user requested to clone the repo inside the container
17
+ RUN git clone https://github.com/AlexaInc/wordlesolver.git .
 
18
 
19
+ # Install dependencies
20
+ RUN npm install
21
 
22
+ # Expose the standard Hugging Face Spaces port
23
  EXPOSE 7860
24
 
25
+ # Command to start both the web server and the bot
26
+ # Note: Ensure you have set BOT_TOKEN in Hugging Face Secrets!
27
+ CMD ["npm", "start"]