diff --git a/backend/Dockerfile b/backend/Dockerfile index ec3bc9d9a508f93b32856106b680b33c8b3264e0..27ee5e64cf348e02584c64eeca5d175075ef0cb9 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,18 +1,69 @@ FROM python:3.8-slim-buster - # system packages installation -RUN apt update && apt install -y ffmpeg libimage-exiftool-perl curl nfs-common cifs-utils libopenblas-dev libmagickwand-dev libheif-dev libmagic1 ufraw-batch libboost-all-dev libxrender-dev liblapack-dev git bzip2 cmake build-essential libsm6 libglib2.0-0 libgl1-mesa-glx libpq-dev --no-install-recommends +RUN apt update && apt install -y ffmpeg libimage-exiftool-perl curl nfs-common cifs-utils libopenblas-dev libheif-dev libmagic1 libraw-dev libboost-all-dev libxrender-dev liblapack-dev git bzip2 cmake build-essential libsm6 libglib2.0-dev libgl1-mesa-glx libpq-dev libexpat-dev \ + librsvg2-dev \ + libpng-dev \ + libgif-dev \ + libjpeg-dev \ + libexif-dev \ + liblcms2-dev \ + liborc-dev \ + pkg-config \ + libexpat1-dev \ + libtiff5-dev \ + libgsf-1-dev \ + libopenexr-dev \ + libcfitsio-dev \ + libimagequant-dev \ + libtool \ + libtool-bin \ + wget \ + libwebp-dev --no-install-recommends + +#Build and install libraw +RUN git clone https://github.com/LibRaw/LibRaw +RUN ls +WORKDIR /LibRaw +RUN autoreconf --install +RUN ./configure +RUN make +RUN make install + +#Build and install imagemagick +WORKDIR / +RUN mkdir /imagemagick +RUN curl -SL https://www.imagemagick.org/download/ImageMagick.tar.gz | tar -zxC /imagemagick +WORKDIR /imagemagick/ImageMagick-7.1.0-4 +RUN ./configure --with-modules +RUN make install +RUN ldconfig /usr/local/lib + +# Build and install libvips +ARG VIPSVERSION=8.11.0 +ARG VIPSURL=https://github.com/libvips/libvips/releases/download +WORKDIR /usr/local/src +RUN wget ${VIPSURL}/v${VIPSVERSION}/vips-${VIPSVERSION}.tar.gz \ + && tar xzf vips-${VIPSVERSION}.tar.gz \ + && cd vips-${VIPSVERSION} \ + && ./configure \ + && make V=0 \ + && make install \ + && ldconfig # pre trained models download WORKDIR /data_models RUN mkdir -p /root/.cache/torch/hub/checkpoints/ + RUN curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/places365.tar.gz | tar -zxC /data_models/ RUN curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/im2txt.tar.gz | tar -zxC /data_models/ RUN curl -SL https://github.com/LibrePhotos/librephotos-docker/releases/download/0.1/clip-embeddings.tar.gz | tar -zxC /data_models/ RUN curl -SL https://download.pytorch.org/models/resnet152-b121ed2d.pth -o /root/.cache/torch/hub/checkpoints/resnet152-b121ed2d.pth + RUN pip install torch==1.8.0+cpu torchvision==0.9.0+cpu -f https://download.pytorch.org/whl/torch_stable.html +RUN pip3 install pyvips + # Build and install dlib WORKDIR / RUN git clone https://github.com/davisking/dlib.git && \ diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh index 295270b5aec160633b91fd517b0705e9a3939e00..12216004dea1ab6ba3255469a8691a4365f685c4 100755 --- a/backend/entrypoint.sh +++ b/backend/entrypoint.sh @@ -16,7 +16,7 @@ python manage.py rqworker default 2>&1 | tee /logs/rqworker.log & if [ "$DEBUG" = 1 ] then - echo "develompent backend starting" + echo "development backend starting" gunicorn --worker-class=gevent --timeout 36000 --reload --bind 0.0.0.0:8001 --log-level=info ownphotos.wsgi 2>&1 | tee /logs/gunicorn_django.log else echo "production backend starting" diff --git a/frontend/Dockerfile b/frontend/Dockerfile index f9d31972412e27c5901bcd1c3730bae21bb92c42..ac9217706f58d1a9249b41b97684abfed28739cc 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /usr/src/app RUN npm install -g serve ENV CLI_WIDTH 80 RUN git clone https://github.com/LibrePhotos/librephotos-frontend /usr/src/app -RUN npm install +RUN npm install --legacy-peer-deps RUN npm run build EXPOSE 3000 diff --git a/frontend/entrypoint.sh b/frontend/entrypoint.sh index 9bae3789ce32a6328f937c179c220454d46c604e..d940e28ae73f6246364978db299c56e1c19ebccd 100755 --- a/frontend/entrypoint.sh +++ b/frontend/entrypoint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo "installing frontend" -npm install +npm install --legacy-peer-deps echo "serving frontend" if [ "$DEBUG" = 1 ]