diff --git a/docker/base.dockerfile b/docker/base.dockerfile index 8609a195245..61a2ca8ce89 100644 --- a/docker/base.dockerfile +++ b/docker/base.dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:bionic +FROM ubuntu:jammy ENV NODE_VERSION=16.20.0 @@ -11,9 +11,9 @@ RUN apt-get update && \ git \ git-lfs \ psmisc \ - python2.7 \ - python-pip \ - python-sphinx + python3 \ + python3-pip \ + python3-sphinx # add yarn ppa RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - @@ -21,19 +21,23 @@ RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources # install nodejs and yarn RUN apt-get update && \ - curl -sSO https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_$NODE_VERSION-1nodesource1_amd64.deb && \ - dpkg -i ./nodejs_$NODE_VERSION-1nodesource1_amd64.deb && \ - rm nodejs_$NODE_VERSION-1nodesource1_amd64.deb && \ + ARCH=$(dpkg --print-architecture) && \ + curl -sSO https://deb.nodesource.com/node_16.x/pool/main/n/nodejs/nodejs_$NODE_VERSION-1nodesource1_$ARCH.deb && \ + dpkg -i ./nodejs_$NODE_VERSION-1nodesource1_$ARCH.deb && \ + rm nodejs_$NODE_VERSION-1nodesource1_$ARCH.deb && \ apt-get install yarn RUN git lfs install +# Check if symbolic links exist before creating them +RUN if [ ! -f /usr/bin/python ]; then ln -s /usr/bin/python3 /usr/bin/python; fi \ + && if [ ! -f /usr/bin/pip ]; then ln -s /usr/bin/pip3 /usr/bin/pip; fi + # copy Kolibri source code into image COPY . /kolibri # do the time-consuming base install commands RUN cd /kolibri \ - && pip install -r requirements/dev.txt \ - && pip install -r requirements/build.txt \ - && pip install -r requirements/test.txt \ + && pip3 install -r requirements/dev.txt \ + && pip3 install -r requirements/test.txt \ && yarn install --network-timeout 100000 diff --git a/docker/demoserver.dockerfile b/docker/demoserver.dockerfile index 55547ee8aed..2bd8bee69b4 100644 --- a/docker/demoserver.dockerfile +++ b/docker/demoserver.dockerfile @@ -2,7 +2,6 @@ FROM learningequality/kolibribase ENV KOLIBRI_RUN_MODE=demoserver ENV KOLIBRI_PROVISIONDEVICE_FACILITY="Kolibri Demo" -ENV WHICH_PYTHON=python2 COPY docker/entrypoint.py /docker/entrypoint.py diff --git a/docker/entrypoint.py b/docker/entrypoint.py index d95d011bc8a..2a5e0a15669 100644 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -38,7 +38,7 @@ # - KOLIBRI_PROVISIONDEVICE_FACILITY if set, provision facility with this name # - CHANNELS_TO_IMPORT if set, comma separated list of channel IDs to import DEFAULT_ENVS = { - "WHICH_PYTHON": "python2", # or python3 if you prefer; Kolibri don't care + "WHICH_PYTHON": "python3", # or python3 if you prefer; Kolibri don't care "KOLIBRI_HOME": "/kolibrihome", "KOLIBRI_HTTP_PORT": "8080", "KOLIBRI_LANG": "en",