Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +32 -9
Dockerfile
CHANGED
|
@@ -1,13 +1,36 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a base image that includes Python and necessary system dependencies
|
| 2 |
+
FROM nikolaik/python-nodejs:python3.10-nodejs20
|
| 3 |
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PORT=7860
|
| 6 |
+
ENV RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.13-nikolaik
|
| 7 |
|
| 8 |
+
# Install system dependencies
|
| 9 |
+
RUN apt-get update && apt-get install -y \
|
| 10 |
+
build-essential \
|
| 11 |
+
curl \
|
| 12 |
+
software-properties-common \
|
| 13 |
+
git \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Create and set working directory
|
| 17 |
+
WORKDIR /app
|
| 18 |
|
| 19 |
+
# Copy application files
|
| 20 |
+
COPY . /app/
|
| 21 |
+
|
| 22 |
+
# Install Python dependencies
|
| 23 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
+
|
| 25 |
+
# Install Node.js dependencies
|
| 26 |
+
RUN npm install
|
| 27 |
+
|
| 28 |
+
# Expose the port Hugging Face Spaces expects
|
| 29 |
+
EXPOSE 7860
|
| 30 |
+
|
| 31 |
+
# Set up healthcheck
|
| 32 |
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
| 33 |
+
CMD curl -f http://localhost:7860/ || exit 1
|
| 34 |
+
|
| 35 |
+
# Command to run the application
|
| 36 |
+
CMD ["python", "app.py"]
|