File size: 1,461 Bytes
40518b9
 
 
 
 
 
 
 
 
 
6285b27
40518b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cb3282a
6285b27
40518b9
6285b27
 
 
40518b9
a9bcf44
6285b27
40518b9
 
a9bcf44
6285b27
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app

# Create static folder structure (if needed by original UI, less critical for pure API)
RUN mkdir -p static/images

# Install system dependencies required by OpenCV and other libraries
RUN apt-get update &&     apt-get install -y --no-install-recommends     libgl1-mesa-glx     libglib2.0-0     && rm -rf /var/lib/apt/lists/*

# Copy the requirements file into the container at /app
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
# Ensure your requirements.txt is clean and includes gunicorn
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application's source code
COPY app.py .
COPY exercises ./exercises
COPY pose_estimation ./pose_estimation
COPY feedback ./feedback
COPY utils ./utils
COPY db ./db
COPY static ./static
COPY templates ./templates
COPY voice_feedback ./voice_feedback
COPY live_test.html .

# Make port available to the world outside this container
# This should match the app_port in README.md and the PORT env variable
EXPOSE 8080

# Define environment variable for the port
ENV PORT 8080
ENV MPLCONFIGDIR /tmp/matplotlib_config_cache

# Run app.py when the container launches using Gunicorn WSGI server
# Use shell form to ensure $PORT is expanded
CMD exec gunicorn --worker-class eventlet -w 1 --bind "0.0.0.0:$PORT" --timeout 0 "app:app"