Spaces:
Running
Running
Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 user to a non-root user for security (Hugging Face requirement)
|
| 8 |
+
RUN useradd -m -u 1000 user
|
| 9 |
+
USER user
|
| 10 |
+
ENV HOME=/home/user \
|
| 11 |
+
PATH=/home/user/.local/bin:$PATH
|
| 12 |
+
|
| 13 |
+
WORKDIR $HOME/app
|
| 14 |
+
|
| 15 |
+
# The user requested to clone the repo inside the container
|
| 16 |
+
# We clone into a temporary directory and move contents to the app directory
|
| 17 |
+
# to avoid issues with non-empty directory or git metadata.
|
| 18 |
+
RUN git clone https://github.com/AlexaInc/wordlesolver.git .
|
| 19 |
+
|
| 20 |
+
# Install dependencies
|
| 21 |
+
RUN npm install
|
| 22 |
+
|
| 23 |
+
# Expose the standard Hugging Face Spaces port
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
|
| 26 |
+
# Command to start both the web server and the bot
|
| 27 |
+
# Note: Ensure you have set BOT_TOKEN in Hugging Face Secrets!
|
| 28 |
+
CMD ["npm", "start"]
|