From ccc3fcceb22b02ba28ba4fa772baa3fe67360968 Mon Sep 17 00:00:00 2001 From: Kobe Buckley Date: Tue, 2 Jul 2024 20:33:55 -1000 Subject: [PATCH] locally installed requirements through dockerfile - no error spinning up sudo docker-compose up --build --- .devcontainer/Dockerfile | 32 ++++++++++++++++++++ .devcontainer/codespaces-requirements.txt | 36 +++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .devcontainer/codespaces-requirements.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index eeb587f8e..25119c7e8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,6 +4,18 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:bullseye # root acess for beginning of the script USER root +# Install main dependencies in one step to reduce layers +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get install -y --no-install-recommends \ + libpoppler-cpp-dev \ + python-is-python3 \ + gdal-bin \ + libgdal-dev \ + imagemagick \ + libmagickwand-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + # [Option] Install zsh ARG INSTALL_ZSH="true" # [Option] Upgrade OS packages to their latest versions @@ -35,6 +47,26 @@ RUN apt-get update \ RUN mkdir -p /usr/share/elasticsearch /var/lib/elasticsearch /var/log/elasticsearch \ && chown -R baseuser:baseuser /usr/share/elasticsearch /var/lib/elasticsearch /var/log/elasticsearch + # Copy the requirements file to the working directory +COPY codespaces-requirements.txt . + +# Display the contents of requirements.txt for debugging +RUN echo "Displaying requirements.txt:" && cat codespaces-requirements.txt + +# Update package list and install pip for Python 3 +RUN apt-get update && \ + apt-get install -y python3-pip + +# Display Python and pip versions for debugging +RUN python3 --version && pip3 --version + +# Upgrade pip +RUN pip3 install --upgrade pip + + +# Install dependencies globally +RUN pip install -r codespaces-requirements.txt + # Switch back to the baseuser USER baseuser diff --git a/.devcontainer/codespaces-requirements.txt b/.devcontainer/codespaces-requirements.txt new file mode 100644 index 000000000..5ec6899c0 --- /dev/null +++ b/.devcontainer/codespaces-requirements.txt @@ -0,0 +1,36 @@ +django==4.2.4 +Markdown==3.4.3 +celery==5.2.7 +django-celery-email==3.0.0 +django-taggit==4.0.0 +pytz==2023.3 +requests==2.31.0 +django-floppyforms==1.9.0 +python-magic==0.4.27 +python-mimeparse==1.6.0 +django-configurations==2.5.1 +django-storages==1.13.2 +dj-database-url==2.0.0 +django-contrib-comments==2.2.0 +unicodecsv==0.14.1 +django-tinymce==3.6.1 +python-docx==0.8.11 +elasticsearch==8.11.1 + +-e git+https://github.com/codewithaloha/froide.git@main#egg=froide + +lxml==5.2.1 +channels==4.0.0 +django-treebeard==4.4 +django-leaflet==0.29.0 +django-json-widget==1.1.1 +django-celery-beat==2.5.0 +django-mfa3==0.11.0 +psycopg[binary]==3.1.18 +psycopg-binary==3.1.18 +-e git+https://github.com/okfde/django-filingcabinet.git@main#egg=django-filingcabinet +oauthlib==3.2.2 +django-oauth-toolkit==1.7.1 +django-fsm==2.8.1 +websockets==11.0.3 +bleach==6.0.0