Loading Dockerfile +66 −9 Original line number Diff line number Diff line Loading @@ -16,23 +16,80 @@ FROM python:3.12-slim # Stablish woking directory # Set working directory WORKDIR /app # Install system dependencies # Install system and build dependencies RUN apt-get update -qq && \ apt-get install -y -qq git python3-dev && \ apt-get install -y -qq \ git \ python3-dev \ build-essential \ cmake \ pkg-config \ libssl-dev \ libpcre2-dev \ libssh-dev \ libcurl4-openssl-dev \ zlib1g-dev \ ca-certificates && \ apt-get clean && rm -rf /var/lib/apt/lists/* # Copy project content COPY . /app ################################ # Build & install libyang ################################ RUN git clone https://github.com/CESNET/libyang.git /tmp/libyang && \ cd /tmp/libyang && \ git checkout v3.13.6 && \ mkdir build && cd build && \ cmake -D CMAKE_BUILD_TYPE=Release .. && \ make -j$(nproc) && \ make install && \ ldconfig && \ rm -rf /tmp/libyang ################################ # Build & install sysrepo ################################ RUN git clone https://github.com/sysrepo/sysrepo.git /tmp/sysrepo && \ cd /tmp/sysrepo && \ git checkout v3.7.11 && \ mkdir build && cd build && \ cmake .. && \ make -j$(nproc) && \ make install && \ ldconfig && \ rm -rf /tmp/sysrepo ################################ # Python dependencies ################################ COPY requirements.txt /app/requirements.txt # Intall python dependencies RUN pip install --upgrade pip && \ pip install -r requirements.txt pip install --no-cache-dir -r requirements.txt ################################ # Application ################################ COPY . /app # Expose port EXPOSE 8081 EXPOSE 8086 RUN sysrepoctl -i /app/yang-modules/ietf-routing-types@2017-12-04.yang \ -i /app/yang-modules/ietf-geo-location@2022-02-11.yang \ -i /app/yang-modules/ietf-ethertypes@2019-03-04.yang \ -i /app/yang-modules/ietf-packet-fields@2019-03-04.yang \ -i /app/yang-modules/ietf-vpn-common@2022-02-11.yang \ -i /app/yang-modules/ietf-network@2018-02-26.yang \ -i /app/yang-modules/ietf-network-topology@2018-02-26.yang \ -i /app/yang-modules/ietf-key-chain@2017-06-15.yang \ -i /app/yang-modules/ietf-ac-common@2025-09-29.yang \ -i /app/yang-modules/ietf-ac-svc@2025-09-29.yang \ -i /app/yang-modules/ietf-te-types@2025-10-17.yang \ -i /app/yang-modules/ietf-te-packet-types@2025-01-24.yang \ -i /app/yang-modules/ietf-network-slice-service@2025-05-09.yang # Init command ENTRYPOINT ["python3", "app.py"] No newline at end of file requirements.txt +3 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,6 @@ pandas dotenv coverage pytest libyang==3.3.0 sysrepo==1.7.6 Loading
Dockerfile +66 −9 Original line number Diff line number Diff line Loading @@ -16,23 +16,80 @@ FROM python:3.12-slim # Stablish woking directory # Set working directory WORKDIR /app # Install system dependencies # Install system and build dependencies RUN apt-get update -qq && \ apt-get install -y -qq git python3-dev && \ apt-get install -y -qq \ git \ python3-dev \ build-essential \ cmake \ pkg-config \ libssl-dev \ libpcre2-dev \ libssh-dev \ libcurl4-openssl-dev \ zlib1g-dev \ ca-certificates && \ apt-get clean && rm -rf /var/lib/apt/lists/* # Copy project content COPY . /app ################################ # Build & install libyang ################################ RUN git clone https://github.com/CESNET/libyang.git /tmp/libyang && \ cd /tmp/libyang && \ git checkout v3.13.6 && \ mkdir build && cd build && \ cmake -D CMAKE_BUILD_TYPE=Release .. && \ make -j$(nproc) && \ make install && \ ldconfig && \ rm -rf /tmp/libyang ################################ # Build & install sysrepo ################################ RUN git clone https://github.com/sysrepo/sysrepo.git /tmp/sysrepo && \ cd /tmp/sysrepo && \ git checkout v3.7.11 && \ mkdir build && cd build && \ cmake .. && \ make -j$(nproc) && \ make install && \ ldconfig && \ rm -rf /tmp/sysrepo ################################ # Python dependencies ################################ COPY requirements.txt /app/requirements.txt # Intall python dependencies RUN pip install --upgrade pip && \ pip install -r requirements.txt pip install --no-cache-dir -r requirements.txt ################################ # Application ################################ COPY . /app # Expose port EXPOSE 8081 EXPOSE 8086 RUN sysrepoctl -i /app/yang-modules/ietf-routing-types@2017-12-04.yang \ -i /app/yang-modules/ietf-geo-location@2022-02-11.yang \ -i /app/yang-modules/ietf-ethertypes@2019-03-04.yang \ -i /app/yang-modules/ietf-packet-fields@2019-03-04.yang \ -i /app/yang-modules/ietf-vpn-common@2022-02-11.yang \ -i /app/yang-modules/ietf-network@2018-02-26.yang \ -i /app/yang-modules/ietf-network-topology@2018-02-26.yang \ -i /app/yang-modules/ietf-key-chain@2017-06-15.yang \ -i /app/yang-modules/ietf-ac-common@2025-09-29.yang \ -i /app/yang-modules/ietf-ac-svc@2025-09-29.yang \ -i /app/yang-modules/ietf-te-types@2025-10-17.yang \ -i /app/yang-modules/ietf-te-packet-types@2025-01-24.yang \ -i /app/yang-modules/ietf-network-slice-service@2025-05-09.yang # Init command ENTRYPOINT ["python3", "app.py"] No newline at end of file
requirements.txt +3 −0 Original line number Diff line number Diff line Loading @@ -23,3 +23,6 @@ pandas dotenv coverage pytest libyang==3.3.0 sysrepo==1.7.6