diff --git a/backend/config/settings/base.py b/backend/config/settings/base.py index 1a095d59..2c140efd 100644 --- a/backend/config/settings/base.py +++ b/backend/config/settings/base.py @@ -107,7 +107,8 @@ STATIC_ROOT = path.join(BASE_DIR, "staticfiles") STATICFILES_DIRS = [ path.join(BASE_DIR, "client/dist/static"), ] -STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" +# STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" +STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage" # Auth settings AUTHENTICATION_BACKENDS = [ diff --git a/docker/Dockerfile b/docker/Dockerfile index 3eec661f..4323c4d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,15 +21,17 @@ RUN apt-get update \ unixodbc-dev=2.* \ g++=4:* \ libssl-dev=1.* \ + curl \ && apt-get clean WORKDIR /tmp -COPY Pipfile* /tmp/ +COPY pyproject.toml /tmp/ # hadolint ignore=DL3013 RUN pip install --upgrade pip \ - && pip install --no-cache-dir --upgrade pipenv \ - && pipenv lock -r > /requirements.txt \ + && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - \ + && PATH="${PATH}:$HOME/.poetry/bin" \ + && poetry export --without-hashes -o /requirements.txt \ && echo "psycopg2-binary==2.8.6" >> /requirements.txt \ && echo "django-heroku==0.3.1" >> /requirements.txt \ && pip install --no-cache-dir -r /requirements.txt \ diff --git a/docker/Dockerfile.prod b/docker/Dockerfile.prod index 0d27c417..fa1ab132 100644 --- a/docker/Dockerfile.prod +++ b/docker/Dockerfile.prod @@ -11,7 +11,7 @@ ENV PYTHONUNBUFFERED 1 RUN groupadd -g 61000 doccano \ && useradd -g 61000 -l -M -s /bin/false -u 61000 doccano -COPY --chown=doccano:doccano ./Pipfile* /backend/ +COPY --chown=doccano:doccano pyproject.toml poetry.lock /backend/ # hadolint ignore=DL3013 RUN apt-get update \ @@ -20,10 +20,13 @@ RUN apt-get update \ libpq-dev=11.* \ unixodbc-dev=2.* \ g++=4:* \ + curl \ && pip install --upgrade pip \ - && pip install --no-cache-dir pipenv \ - && pipenv install --system --deploy \ - && pip uninstall -y pipenv virtualenv-clone virtualenv \ + && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - \ + && PATH="${PATH}:$HOME/.poetry/bin" \ + && poetry config virtualenvs.create false \ + && poetry install --no-dev --no-root \ + && poetry add psycopg2-binary \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* @@ -34,7 +37,7 @@ RUN mkdir -p /backend/staticfiles \ && chown -R doccano:doccano /backend/ COPY --chown=doccano:doccano ./backend/ /backend/ - +RUN ls /backend USER doccano:doccano VOLUME /backend/staticfiles