Dockerfile 1.02 KB
Newer Older
1
2
3
4
5
6
7
8
FROM ubuntu:22.04

LABEL maintainer="Matteo Spanio"

WORKDIR /app

COPY . ./

Matteo's avatar
Matteo committed
9
RUN apt update && apt install libboost-program-options-dev  git build-essential cmake g++ wget unzip python3 python3-pip -y
10
11
12
13
14
15
16
17
18
19
20

RUN mkdir opencv_source && cd ./opencv_source && wget -O opencv.zip https://github.com/opencv/opencv/archive/4.5.4.zip && wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/4.5.4.zip && unzip opencv.zip && unzip opencv_contrib.zip && mkdir -p build && cd ./build && cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.5.4/modules ../opencv-4.5.4 && make -j4 && make install && cd /app

RUN git clone https://github.com/nlohmann/json.git

RUN cd ./json && mkdir build && cd ./build && cmake .. && make && make install && cd /app

RUN rm -r opencv_source json

RUN cd ./build && cmake .. && make && cd /app

Matteo's avatar
Matteo committed
21
22
RUN cd ./server && pip install --no-cache-dir -r requirements.txt && cd /app

23
24
VOLUME [ "/data" ]

Matteo's avatar
Matteo committed
25
CMD ["uvicorn", "server.main:app", "--host", "0.0.0.0", "--log-config", "server/config.yaml", "--port", "80"]