Spaces:
Sleeping
Sleeping
app.py
Browse files- Dockerfile +24 -0
Dockerfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Copy the requirements file into the container at /code
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Install any needed packages specified in requirements.txt
|
| 11 |
+
# --no-cache-dir: Disables the cache which reduces the image size
|
| 12 |
+
# --trusted-host pypi.python.org: Solves issues with SSL/TLS verification in some environments
|
| 13 |
+
RUN pip install --no-cache-dir --trusted-host pypi.python.org -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Copy the rest of the application files into the container at /code
|
| 16 |
+
COPY . .
|
| 17 |
+
|
| 18 |
+
# Make port 7860 available to the world outside this container
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
# Define the command to run the application
|
| 22 |
+
# Use the --server-name 0.0.0.0 flag to make the app accessible from outside the container
|
| 23 |
+
# Use the --share flag to create a public link if needed (optional)
|
| 24 |
+
CMD ["python3", "app.py"]
|