test_API / Dockerfile
ehsanhon's picture
Update Dockerfile
59d2d71 verified
Raw History Blame
941 Bytes
FROM python:3.10-slim
# Install necessary system packages
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Optional: install ngrok if using flask-ngrok
RUN wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip && \
unzip ngrok-stable-linux-amd64.zip -d /usr/local/bin && \
chmod +x /usr/local/bin/ngrok && \
rm ngrok-stable-linux-amd64.zip
# Fix for matplotlib permission issue
ENV MPLCONFIGDIR=/tmp/matplotlib
# Set working directory
WORKDIR /app
# Install Python dependencies
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY . .
# Expose the Flask port
EXPOSE 7860
# Run the app
CMD ["python", "app.py"]
# FROM python:3.10-slim
# WORKDIR /app
# COPY . /app
# RUN pip install --no-cache-dir -r requirements.txt
# EXPOSE 7860
# CMD ["python", "app.py"]