Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a Python base image with necessary libraries
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set environment variables to avoid prompts
|
5 |
+
ENV PYTHONUNBUFFERED 1
|
6 |
+
|
7 |
+
# Set the working directory inside the container
|
8 |
+
WORKDIR /app
|
9 |
+
|
10 |
+
# Install system dependencies
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
git \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
+
|
15 |
+
# Install necessary Python packages
|
16 |
+
RUN pip install --upgrade pip
|
17 |
+
RUN pip install git+https://github.com/bigscience-workshop/petals
|
18 |
+
|
19 |
+
# Copy the Python script into the container
|
20 |
+
COPY setup_petal_swarm.py /app/setup_petal_swarm.py
|
21 |
+
|
22 |
+
# Expose the necessary port (31337 is the default port for Petals)
|
23 |
+
EXPOSE 31337
|
24 |
+
|
25 |
+
# Set the command to run the Python script on container startup
|
26 |
+
CMD ["python", "/app/setup_petal_swarm.py"]
|