-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (40 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
49 lines (40 loc) · 1.28 KB
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
44
45
46
47
48
49
# Use an official Ubuntu 18.04 base image
FROM ubuntu:18.04
# Install Python 3.7, pip, and Node.js
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
&& add-apt-repository ppa:deadsnakes/ppa \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get update && apt-get install -y \
python3.7 \
python3-pip \
python3.7-dev \
git \
libsm6 \
libxext6 \
libxrender-dev \
libgl1-mesa-glx \
nodejs \
&& apt-get clean
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install Python dependencies
RUN pip3 install --upgrade pip
RUN pip3 install numpy
RUN pip3 install opencv-python
RUN pip3 install tensorflow==2.5.0
RUN pip3 install mediapipe flask flask-cors
# Install Node.js dependencies and build the React app
RUN cd frontend && npm install && npm run build
# Make port 5000 available to the world outside this container
EXPOSE 5000
# Define environment variable
ENV NAME OpencvMediaPipeFlask
# Copy the React build to a folder served by Flask
# Assume your Flask app is set up to serve files from the 'build' directory
RUN cp -r client/* static/
# Run app.py when the container launches
CMD ["python3.7", "run.py"]