Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +15 -20
Dockerfile
CHANGED
|
@@ -1,32 +1,27 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
-
RUN apt-get update && apt-get install -y -
|
| 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
|
| 16 |
WORKDIR /home/node/app
|
| 17 |
RUN chown -R node:node /home/node/app
|
| 18 |
|
|
|
|
| 19 |
USER node
|
| 20 |
ENV HOME=/home/node \
|
| 21 |
-
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
RUN npm install --omit=dev
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
|
|
|
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
| 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"]
|