diff --git a/Dockerfile b/Dockerfile index cb5da2f40539..9afb24ae1124 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM python:3.6.9-jessie ARG http_proxy ARG https_proxy @@ -19,29 +19,33 @@ ARG USER ARG DJANGO_CONFIGURATION ENV DJANGO_CONFIGURATION=${DJANGO_CONFIGURATION} +# Install ffmpeg on debian jessie (https://www.deb-multimedia.org/) +# It is not available on official repositories (https://wiki.debian.org/ffmpeg) +RUN echo "deb http://www.deb-multimedia.org jessie main non-free" > /etc/apt/sources.list.d/deb-multimedia.list && \ + apt-get update && \ + apt-get install -yq --force-yes \ + deb-multimedia-keyring && \ + apt-get update && \ + apt-get install -yq \ + ffmpeg \ + gstreamer0.10-ffmpeg && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + # Install necessary apt packages RUN apt-get update && \ apt-get install -yq \ - python-software-properties \ software-properties-common \ wget && \ - add-apt-repository ppa:mc3man/xerus-media -y && \ - add-apt-repository ppa:mc3man/gstffmpeg-keep -y && \ - apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -yq \ apache2 \ apache2-dev \ libapache2-mod-xsendfile \ - supervisor \ - ffmpeg \ - gstreamer0.10-ffmpeg \ libldap2-dev \ libsasl2-dev \ - python3-dev \ - python3-pip \ tzdata \ unzip \ - unrar \ + unrar-free \ p7zip-full \ vim \ git-core \ @@ -50,8 +54,6 @@ RUN apt-get update && \ pip3 install -U setuptools && \ ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \ dpkg-reconfigure -f noninteractive tzdata && \ - add-apt-repository --remove ppa:mc3man/gstffmpeg-keep -y && \ - add-apt-repository --remove ppa:mc3man/xerus-media -y && \ rm -rf /var/lib/apt/lists/* # Add a non-root user @@ -115,7 +117,7 @@ RUN if [ "$WITH_TESTS" = "yes" ]; then \ # Install and initialize CVAT, copy all necessary files COPY cvat/requirements/ /tmp/requirements/ COPY supervisord.conf mod_wsgi.conf wait-for-it.sh manage.py ${HOME}/ -RUN pip3 install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt +RUN pip3 install -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt # pycocotools package is impossible to install with its dependencies by one pip install command RUN pip3 install --no-cache-dir pycocotools==2.0.0 @@ -167,7 +169,7 @@ RUN chown -R ${USER}:${USER} . USER ${USER} RUN mkdir data share media keys logs /tmp/supervisord -RUN python3 manage.py collectstatic +RUN python3 manage.py collectstatic || python3 manage.py collectstatic EXPOSE 8080 8443 -ENTRYPOINT ["/usr/bin/supervisord"] +ENTRYPOINT ["supervisord"] diff --git a/Dockerfile.ui b/Dockerfile.ui index c5939296849e..642d382d9ce1 100644 --- a/Dockerfile.ui +++ b/Dockerfile.ui @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 AS cvat-ui +FROM node:10.16.3-buster-slim AS cvat-ui ARG http_proxy ARG https_proxy @@ -14,10 +14,6 @@ ENV TERM=xterm \ ENV LANG='C.UTF-8' \ LC_ALL='C.UTF-8' -# Install necessary apt packages -RUN apt update && apt install -yq nodejs npm curl && \ - npm install -g n && n 10.16.3 - # Create output directories RUN mkdir /tmp/cvat-ui /tmp/cvat-core diff --git a/cvat/requirements/base.txt b/cvat/requirements/base.txt index 3c8c5d52617d..9a4d308fca20 100644 --- a/cvat/requirements/base.txt +++ b/cvat/requirements/base.txt @@ -47,3 +47,4 @@ h5py==2.9.0 imgaug==0.2.9 django-cors-headers==3.0.2 furl==2.0.0 +supervisor==4.1.0 diff --git a/cvat/requirements/production.txt b/cvat/requirements/production.txt index 340e26bed754..a7edbe9bbe84 100644 --- a/cvat/requirements/production.txt +++ b/cvat/requirements/production.txt @@ -1,3 +1,3 @@ -r base.txt psycopg2-binary==2.7.4 -mod-wsgi==4.6.2 \ No newline at end of file +mod-wsgi==4.6.2 diff --git a/supervisord.conf b/supervisord.conf index d5e222d2a99b..3c1485302d55 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -24,26 +24,26 @@ autorestart=true [program:rqworker_default] command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \ - "exec /usr/bin/python3 %(ENV_HOME)s/manage.py rqworker -v 3 default" + "exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 default" environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock" numprocs=2 process_name=rqworker_default_%(process_num)s [program:rqworker_low] command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \ - "exec /usr/bin/python3 %(ENV_HOME)s/manage.py rqworker -v 3 low" + "exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 low" environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock" numprocs=1 [program:git_status_updater] command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \ - "/usr/bin/python3 ~/manage.py update_git_states" + "python3 ~/manage.py update_git_states" environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock" numprocs=1 [program:rqscheduler] command=%(ENV_HOME)s/wait-for-it.sh redis:6379 -t 0 -- bash -ic \ - "/usr/bin/python3 /usr/local/bin/rqscheduler --host redis -i 30" + "python3 /usr/local/bin/rqscheduler --host redis -i 30" environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock" numprocs=1 @@ -54,9 +54,9 @@ numprocs=1 ; with docker cache. Thus it is necessary to run collectstatic here for such ; apps. command=%(ENV_HOME)s/wait-for-it.sh db:5432 -t 0 -- bash -ic \ - "/usr/bin/python3 ~/manage.py migrate && \ - /usr/bin/python3 ~/manage.py collectstatic --no-input && \ - exec /usr/bin/python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \ + "python3 ~/manage.py migrate && \ + python3 ~/manage.py collectstatic --no-input && \ + exec python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \ --limit-request-body 1073741824 --log-level INFO --include-file ~/mod_wsgi.conf \ %(ENV_DJANGO_MODWSGI_EXTRA_ARGS)s --locale %(ENV_LC_ALL)s" environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"