bodybuilding-pose-app / Dockerfile
Sean Carnahan
Fix mediapipe model file permissions in Dockerfile
fded136
raw
history blame
1.2 kB
# Use a Python version that matches your (keras2env) as closely as possible
FROM python:3.9-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Fix permissions for mediapipe model files
RUN chmod -R 755 /usr/local/lib/python3.9/site-packages/mediapipe
# Copy all necessary application files and folders from HFup/ to /app in the container
# These paths are relative to the Dockerfile's location (i.e., inside HFup/)
COPY app.py .
RUN echo "Listing files:" && ls -la # Debug: List files in the build context root
COPY bodybuilding_pose_analyzer bodybuilding_pose_analyzer
COPY external external
# COPY yolov7 yolov7
# COPY yolov7-w6-pose.pt .
COPY static static
COPY templates templates
# Ensure the uploads directory within static exists and is writable
RUN mkdir -p static/uploads && chmod -R 777 static/uploads
EXPOSE 7860
# Command to run app with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "2", "--timeout", "300", "app:app"]