Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as the base image
|
| 2 |
+
FROM python:3.8-slim
|
| 3 |
+
|
| 4 |
+
# Prevent Python from writing .pyc files and buffering stdout/stderr
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
|
| 8 |
+
# Set the working directory in the container
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# Copy over the requirements file
|
| 12 |
+
# Note: Create a requirements.txt with the necessary packages (see note below)
|
| 13 |
+
COPY requirements.txt /app/requirements.txt
|
| 14 |
+
|
| 15 |
+
# Install the Python dependencies
|
| 16 |
+
RUN pip install --upgrade pip && \
|
| 17 |
+
pip install --no-cache-dir -r /app/requirements.txt
|
| 18 |
+
|
| 19 |
+
# Copy the rest of the application code
|
| 20 |
+
COPY . /app
|
| 21 |
+
|
| 22 |
+
# Expose the port that the app runs on
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Command to run the application
|
| 26 |
+
CMD ["python", "app.py"]
|