Create Dockerfile
Browse files- Dockerfile +50 -0
 
    	
        Dockerfile
    ADDED
    
    | 
         @@ -0,0 +1,50 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            # Use an official Python runtime as a parent image
         
     | 
| 2 | 
         
            +
            FROM python:3.11-slim
         
     | 
| 3 | 
         
            +
             
     | 
| 4 | 
         
            +
            # Set the working directory to /app
         
     | 
| 5 | 
         
            +
            WORKDIR /app
         
     | 
| 6 | 
         
            +
             
     | 
| 7 | 
         
            +
            # Install system dependencies for Playwright
         
     | 
| 8 | 
         
            +
            RUN apt-get update && apt-get install -y --no-install-recommends \
         
     | 
| 9 | 
         
            +
                wget \
         
     | 
| 10 | 
         
            +
                unzip \
         
     | 
| 11 | 
         
            +
                libx11-xcb1 \
         
     | 
| 12 | 
         
            +
                libxcomposite1 \
         
     | 
| 13 | 
         
            +
                libxcursor1 \
         
     | 
| 14 | 
         
            +
                libxdamage1 \
         
     | 
| 15 | 
         
            +
                libxi6 \
         
     | 
| 16 | 
         
            +
                libxtst6 \
         
     | 
| 17 | 
         
            +
                libnss3 \
         
     | 
| 18 | 
         
            +
                libcups2 \
         
     | 
| 19 | 
         
            +
                libxss1 \
         
     | 
| 20 | 
         
            +
                libxrandr2 \
         
     | 
| 21 | 
         
            +
                libasound2 \
         
     | 
| 22 | 
         
            +
                libatk1.0-0 \
         
     | 
| 23 | 
         
            +
                libatk-bridge2.0-0 \
         
     | 
| 24 | 
         
            +
                libcairo2 \
         
     | 
| 25 | 
         
            +
                libgdk-pixbuf2.0-0 \
         
     | 
| 26 | 
         
            +
                libgtk-3-0 \
         
     | 
| 27 | 
         
            +
                libpango-1.0-0 \
         
     | 
| 28 | 
         
            +
                libpangocairo-1.0-0 \
         
     | 
| 29 | 
         
            +
                libx11-6 \
         
     | 
| 30 | 
         
            +
                && rm -rf /var/lib/apt/lists/*
         
     | 
| 31 | 
         
            +
             
     | 
| 32 | 
         
            +
            # Copy the current directory contents into the container at /app
         
     | 
| 33 | 
         
            +
            COPY . /app/
         
     | 
| 34 | 
         
            +
             
     | 
| 35 | 
         
            +
            # Install any needed packages specified in requirements.txt
         
     | 
| 36 | 
         
            +
            RUN pip install --no-cache-dir -r requirements.txt
         
     | 
| 37 | 
         
            +
             
     | 
| 38 | 
         
            +
            # Install Playwright browsers
         
     | 
| 39 | 
         
            +
            RUN playwright install chromium
         
     | 
| 40 | 
         
            +
             
     | 
| 41 | 
         
            +
            # Make port available to the world outside this container (if you add a server later)
         
     | 
| 42 | 
         
            +
            # EXPOSE 8000
         
     | 
| 43 | 
         
            +
             
     | 
| 44 | 
         
            +
            # Define environment variables (replace with your actual username and password)
         
     | 
| 45 | 
         
            +
            # Best practice: Use Docker secrets or environment variables during `docker run`
         
     | 
| 46 | 
         
            +
            # ENV HUGGINGFACE_USERNAME=your_username
         
     | 
| 47 | 
         
            +
            # ENV HUGGINGFACE_PASSWORD=your_password
         
     | 
| 48 | 
         
            +
             
     | 
| 49 | 
         
            +
            # Run the app when the container launches
         
     | 
| 50 | 
         
            +
            CMD ["python", "app.py"]
         
     |