forked from NoahGWood/OpenEFT
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
61 lines (49 loc) · 1.66 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Base image
FROM ubuntu:20.04
# Expose port 8080
EXPOSE 8080
# Disable interactive prompts during package installation
ARG DEBIAN_FRONTEND=noninteractive
# Set environment variables
ENV PATH="/root/OpenEFT/nbis/nfseg/bin:/root/OpenEFT/nbis/nfiq/bin:$PATH"
# Update and install required packages, including cmake, X11 development libraries, and openjpeg
RUN apt-get update && apt-get install -y \
git \
sudo \
build-essential \
cmake \
libopenjp2-7-dev \
libgl1-mesa-glx \
libx11-dev \
libxext-dev \
python3 \
python3-pip \
bash
# Clone the OpenEFT repository
RUN git clone https://github.com/robbbbbbbbb/OpenEFT.git /root/OpenEFT && \
cd /root/OpenEFT && git pull
# Set working directory to the cloned repo
WORKDIR /root/OpenEFT
# Clone and set up NBIS in the repo directory
RUN mkdir /root/build && \
echo "Setting Up NBIS" && \
git clone https://github.com/Robbbbbbbbb/nbis /root/OpenEFT/nbis && \
cd /root/OpenEFT/nbis && \
./setup.sh /root/build --64 && \
echo "Configuring NBIS" && \
make config && \
echo "Making NBIS" && \
make it && \
echo "Installing NBIS" && \
make install LIBNBIS=no
# Add NBIS binaries to PATH
RUN echo 'export PATH="/root/OpenEFT/nbis/nfseg/bin:$PATH"' >> ~/.bashrc && \
echo 'export PATH="/root/OpenEFT/nbis/nfiq/bin:$PATH"' >> ~/.bashrc
# Install Python dependencies from the requirements.txt in the OpenEFT repo
RUN pip3 install -r requirements.txt
# Run Django migrations
RUN python3 manage.py migrate
# Run the build_linux.sh script
RUN chmod +x build_docker.sh && ./build_docker.sh
# Set the default command to run the application
CMD ["python3", "openeft.py"]