Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python 3.10 base image
|
| 2 |
+
FROM python:3.10
|
| 3 |
+
|
| 4 |
+
# Set the working directory
|
| 5 |
+
WORKDIR /home/user/app
|
| 6 |
+
|
| 7 |
+
# Install wget, add Google Chrome repository, and install Chrome and its dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y wget gnupg && \
|
| 9 |
+
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - && \
|
| 10 |
+
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' && \
|
| 11 |
+
apt-get update && \
|
| 12 |
+
apt-get install -y google-chrome-stable libnss3 libgconf-2-4 libdbus-glib-1-2 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libgbm1 libasound2 && \
|
| 13 |
+
rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Install Python dependencies
|
| 16 |
+
COPY requirements.txt .
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
# Copy the rest of the application code
|
| 20 |
+
COPY . .
|
| 21 |
+
|
| 22 |
+
# Set environment variables for the user and expose the port
|
| 23 |
+
ENV GRADIO_SERVER_PORT=7860
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
|
| 26 |
+
# Set the entrypoint to start the Gradio app
|
| 27 |
+
CMD ["python", "app.py"]
|