Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,68 @@ COPY . .
# Build LPVS-open-source application
RUN mvn clean install

# Base image for running lpvs container
# OpenJDK 17 stage
FROM openjdk:17-slim@sha256:aaa3b3cb27e3e520b8f116863d0580c438ed55ecfa0bc126b41f68c3f62f9774

# Install dependencies and remove tmp files
# Install build dependencies for Python compilation
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y python3-pip && \
apt-get install -y \
ca-certificates \
wget \
build-essential \
libssl-dev \
zlib1g-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libgdbm-dev \
libdb5.3-dev \
libbz2-dev \
libexpat1-dev \
libffi-dev \
liblzma-dev \
uuid-dev && \
apt-get clean

# Download and compile Python 3.13 from source with optimizations
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/root/.cache/pip \
wget https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tgz && \
tar xzf Python-3.13.1.tgz && \
cd Python-3.13.1 && \
./configure \
--enable-optimizations \
--enable-shared \
--with-ensurepip=install \
--prefix=/usr/local \
--disable-test-modules \
--disable-tk \
--disable-curses \
LDFLAGS="-Wl,-rpath,/usr/local/lib" && \
make -j$(nproc) PROFILE_TASK="" && \
make altinstall && \
cd .. && \
rm -rf Python-3.13.1 Python-3.13.1.tgz

# Create symlinks for easier access
RUN ln -sf /usr/local/bin/python3.13 /usr/bin/python3.13 && \
ln -sf /usr/local/bin/pip3.13 /usr/bin/pip3.13 && \
ln -sf /usr/local/bin/python3.13 /usr/bin/python3 && \
ln -sf /usr/local/bin/pip3.13 /usr/bin/pip3

# Update shared library cache
RUN ldconfig

# Clean up apt caches and tmp files
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /root/

# Install SCANOSS
COPY --from=builder /root/requirements.txt ./
RUN pip3 install --require-hashes -r requirements.txt
RUN python3.13 -m pip install --require-hashes -r requirements.txt

# Allow to listen port 7896
EXPOSE 7896
Expand Down
Loading