Installing django sitetree with docker does not work

36 Views Asked by At

The following is an excerpt of my Dockerfile

FROM centos:7.5.1804

RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash -

# Upgrade, install Python, install a bunch of other important dev libraries.
RUN yum install -y expat \
    ...
    python2 \
    python2-devel \
    python2-dateutil \
    python2-pytz \
    python2-setuptools \
    python2-tkinter \
    python-matplotlib \
    ...
    # pyparsing uninstalled as it conflicts with the pip install of pyparsing
    # ipaddress uninstalled as it conflicts with the pip install of crossbar==17.12.1
    yum erase -y pyparsing python-ipaddress && \
    yum clean all && \
    # curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" && python get-pip.py && rm -f get-pip.py
    curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" -o "get-pip.py" && python get-pip.py && rm -f get-pip.py

...

RUN cd ...
    ...

# # Install pip packages
RUN pip install numpy==1.16.5
RUN pip install -r requirements.txt
RUN python manage.py sitetree_resync_apps --settings=sites.production.settings
RUN python manage.py collectstatic --settings=sites.production.settings --noinput

and this is an excerpt of my requirements.txt

Django==1.8.6
Pillow==3.0.0
XlsxWriter==0.8.4
amqp==1.4.9
anyjson==0.3.3
backports.functools-lru-cache==1.6.1
beautifulsoup4==4.8.2
billiard==3.3.0.23
celery==3.1.25
cssutils==1.0.2
django-autocomplete-light==2.1.1
django-bootstrap3==6.2.2
django-bootstrap3-datetimepicker-2==2.4.2
django-celery==3.1.17
django-cors-headers==1.1.0
django-crispy-forms==1.5.2
django-datatable-view==0.8.2
django-extensions==1.5.9
django-formtools==1.0
django-grappelli==2.7.1
django-ical==1.3
django-inlinecss==0.1.2
django-model-utils==2.3.1
django-money==0.7.4
django-post-office==2.0.3
django-sitetree==1.8.0
...

the code:

RUN python manage.py sitetree_resync_apps --settings=sites.production.settings

used to run successfully but now I get the errors:

1.268   File "/usr/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
1.268     return self.cursor.execute(sql, params)
1.268 django.db.utils.ProgrammingError: relation "sitetree_tree" does not exist
1.268 LINE 1: ...etree_tree"."title", "sitetree_tree"."alias" FROM "sitetree_...
1.268                                                              ^
1.268
1.268 Sitetrees found in `mcvitty.navigation` app ...
1.268   Processing `workbenches` tree ...
------
Dockerfile:69
--------------------
  67 |     RUN pip install -r requirements.txt
  68 |     RUN pip list
  69 | >>> RUN python manage.py sitetree_resync_apps --settings=sites.production.settings
  70 |     RUN python manage.py collectstatic --settings=sites.production.settings --noinput
  71 |
--------------------
ERROR: failed to solve: process "/bin/sh -c python manage.py sitetree_resync_apps --settings=sites.production.settings" did not complete successfully: exit code: 1

it looks like the sitetree library cannot be found despite the fact that the installation of the libraries in the requirements.txt

RUN pip install -r requirements.txt

executes without errors. Any idea?

Thank you

0

There are 0 best solutions below