game / Dockerfile
sagar007's picture
Create Dockerfile
d95dca5 verified
FROM ubuntu:20.04
# Avoid interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install Python 3.9, wget, unzip, and Chrome dependencies
RUN apt-get update && apt-get install -y \
python3.9 \
python3.9-distutils \
wget \
unzip \
libxss1 \
libappindicator1 \
libindicator7 \
fonts-liberation \
libnss3 \
xdg-utils
# Install pip for Python 3.9
RUN wget https://bootstrap.pypa.io/get-pip.py && python3.9 get-pip.py
# Install Google Chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& dpkg -i google-chrome-stable_current_amd64.deb || apt-get install -f -y \
&& rm google-chrome-stable_current_amd64.deb
# Set working directory
WORKDIR /app
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip3.9 install --no-cache-dir -r requirements.txt chromedriver-autoinstaller
# Copy your application code
COPY app.py .
# Run the app with Python 3.9
CMD ["python3.9", "app.py"]