-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix dockerfile to install dependencies
- Loading branch information
Showing
5 changed files
with
108 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,59 @@ | ||
# Using a slim version for a smaller base image | ||
FROM python:3.11.6-slim-bullseye@sha256:0c1fbb294096d842ad795ee232d783cab436c90b034210fe894f2bb2f2be7626 | ||
|
||
RUN useradd -ms /bin/bash user | ||
USER user | ||
|
||
# Define development mode environment variables | ||
ARG DEV_MODE | ||
ENV DEV_MODE=$DEV_MODE | ||
|
||
# Install GEOS library, Rust, and other dependencies, then clean up | ||
# RUN apt-get clean && apt-get update && apt-get install -y \ | ||
# libgeos-dev \ | ||
# libcurl4-openssl-dev \ | ||
# libssl-dev \ | ||
# binutils \ | ||
# pandoc \ | ||
# curl \ | ||
# git \ | ||
# poppler-utils \ | ||
# tesseract-ocr \ | ||
# autoconf \ | ||
# automake \ | ||
# build-essential \ | ||
# libtool \ | ||
# python-dev \ | ||
# build-essential \ | ||
# # Additional dependencies for document handling | ||
# libmagic-dev \ | ||
# poppler-utils \ | ||
# tesseract-ocr \ | ||
# libreoffice \ | ||
# libpq-dev \ | ||
# gcc \ | ||
# pandoc && \ | ||
# rm -rf /var/lib/apt/lists/* && apt-get clean | ||
|
||
# Add Rust binaries to the PATH | ||
# ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
WORKDIR /home/user | ||
# Install geos, rust, and other dependencies, then clean up | ||
RUN apt-get clean && apt-get update && apt-get install -y \ | ||
libgeos-dev \ | ||
libcurl4-openssl-dev \ | ||
libssl-dev \ | ||
binutils \ | ||
pandoc \ | ||
curl \ | ||
git \ | ||
poppler-utils \ | ||
tesseract-ocr \ | ||
autoconf \ | ||
automake \ | ||
build-essential \ | ||
libtool \ | ||
python-dev \ | ||
build-essential \ | ||
# Additional dependencies | ||
# for document handling | ||
libmagic-dev \ | ||
poppler-utils \ | ||
tesseract-ocr \ | ||
libreoffice \ | ||
libpq-dev \ | ||
gcc \ | ||
pandoc && \ | ||
rm -rf /var/lib/apt/lists/* && apt-get clean | ||
|
||
# Add rust binaries to the path | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Create and select workspace dir | ||
WORKDIR /code | ||
|
||
# Copy just the requirements first | ||
COPY requirements.txt . | ||
|
||
# Upgrade pip | ||
# Upgrade pip to the latest version | ||
RUN pip install --upgrade pip | ||
|
||
# Increase timeout to wait for the new installation | ||
# RUN pip install --no-cache-dir -r requirements.txt --timeout 20000 && rm requirements.txt | ||
RUN pip install -r requirements.txt && rm requirements.txt | ||
# RUN if [ "$DEV_MODE" = "true" ]; then pip install --no-cache debugpy --timeout 200; fi | ||
RUN pip install --no-cache-dir -r requirements.txt --timeout 20000 && rm requirements.txt | ||
RUN if [ "$DEV_MODE" = "true" ]; then pip install --no-cache debugpy --timeout 200; fi | ||
|
||
# Copy the rest of the application | ||
COPY . . | ||
|
||
# Listen on 10000 port instead 8080 | ||
EXPOSE 10000 | ||
|
||
# Launch the dockerized application | ||
ENTRYPOINT [ "python", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Using a slim version for a smaller base image | ||
FROM python:3.11.6-slim-bullseye@sha256:0c1fbb294096d842ad795ee232d783cab436c90b034210fe894f2bb2f2be7626 | ||
|
||
# Define development mode environment variables | ||
ARG DEV_MODE | ||
ENV DEV_MODE=$DEV_MODE | ||
|
||
# Install geos, rust, and other dependencies, then clean up | ||
RUN apt-get clean && apt-get update && apt-get install -y \ | ||
libgeos-dev \ | ||
libcurl4-openssl-dev \ | ||
libssl-dev \ | ||
binutils \ | ||
pandoc \ | ||
curl \ | ||
git \ | ||
poppler-utils \ | ||
tesseract-ocr \ | ||
autoconf \ | ||
automake \ | ||
build-essential \ | ||
libtool \ | ||
python-dev \ | ||
build-essential \ | ||
# Additional dependencies | ||
# for document handling | ||
libmagic-dev \ | ||
poppler-utils \ | ||
tesseract-ocr \ | ||
libreoffice \ | ||
libpq-dev \ | ||
gcc \ | ||
pandoc && \ | ||
rm -rf /var/lib/apt/lists/* && apt-get clean | ||
|
||
# Add rust binaries to the path | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Create and select workspace dir | ||
WORKDIR /code | ||
|
||
# Copy just the requirements first | ||
COPY requirements.txt . | ||
|
||
# Upgrade pip to the latest version | ||
RUN pip install --upgrade pip | ||
|
||
# Increase timeout to wait for the new installation | ||
RUN pip install --no-cache-dir -r requirements.txt --timeout 200 && rm requirements.txt | ||
RUN if [ "$DEV_MODE" = "true" ]; then pip install --no-cache debugpy --timeout 200; fi | ||
|
||
# Copy the rest of the application | ||
COPY . . | ||
|
||
# Listen on 10000 port instead 8080 | ||
EXPOSE 10000 | ||
|
||
# Launch the dockerized application | ||
ENTRYPOINT [ "python", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters