-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (31 loc) · 971 Bytes
/
Dockerfile
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
# Use an official Python runtime as a parent image
FROM --platform=linux/arm64/v8 python:3.9.19-slim-bullseye
# Set the working directory
WORKDIR /app
# Copy the requirements file
COPY requirements.txt ./
ENV PYTHONPATH=/app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
python3-dev \
libc-dev \
pkg-config \
libhdf5-dev \
&& \
rm -rf /var/lib/apt/lists/*
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Install OpenCV dependencies
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy the current directory contents into the container at /app
COPY . .
# Make port 27018 available to the world outside this container
EXPOSE 27018
# Define environment variable
ENV NAME FastAPIApp
# Run app.py when the container launches
CMD ["python3", "main.py"]