Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Mar 24, 2024
1 parent 2940fdd commit 185599d
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ FROM --platform=$BUILDPLATFORM python:3.12-bookworm AS builder
ENV POETRY_VERSION=1.8.2

# Install Node.js v20
RUN --mount=type=cache,target=/var/cache/apt apt-get update && apt-get install -y curl=7.88.1-10+deb12u5 --no-install-recommends && \
RUN --mount=type=cache,target=/var/cache/apt \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nsolid
apt-get update && apt-get install -y nsolid apt-utils build-essential python3-dev cargo pkg-config --no-install-recommends

# Install Poetry
RUN pip install --no-cache-dir poetry==${POETRY_VERSION}
Expand All @@ -33,14 +33,14 @@ RUN poetry run invenio collect --verbose && \

FROM python:3.12-slim-bookworm AS runtime

WORKDIR /opt/invenio

ENV VIRTUAL_ENV=/opt/invenio/.venv \
PATH="/opt/invenio/.venv/bin:$PATH" \
INVENIO_INSTANCE_PATH=/opt/invenio/var/instance

COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}

WORKDIR /opt/invenio

# RUN mkdir ${INVENIO_INSTANCE_PATH}/data && \
# mkdir ${INVENIO_INSTANCE_PATH}/archive

Expand All @@ -58,6 +58,19 @@ ENV INVENIO_USER_ID=1000
# # chmod -R g=u ${WORKDIR} && \
# # chown -R invenio:root ${WORKDIR}

# For the full list of settings and their values, see
# https://inveniordm.docs.cern.ch/reference/configuration/
ENV INVENIO_ACCOUNTS_SESSION_REDIS_URL=redis://cache:6379/1 \
INVENIO_BROKER_URL= \
INVENIO_CACHE_REDIS_URL=redis://cache:6379/0 \
INVENIO_CACHE_TYPE=redis \
INVENIO_CELERY_BROKER_URL= \
INVENIO_CELERY_RESULT_BACKEND=redis://cache:6379/2 \
INVENIO_SEARCH_HOSTS=['search:9200'] \
INVENIO_SECRET_KEY=CHANGE_ME \
INVENIO_SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://invenio-rdm-starter:invenio-rdm-starter@db/invenio-rdm-starter \
INVENIO_RATELIMIT_STORAGE_URL=redis://cache:6379/3

# USER invenio
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "invenio_app.wsgi"]
EXPOSE 5000
CMD ["gunicorn", "invenio_app.wsgi:application", "--bind", "0.0.0.0:5000", "--workers", "4"]

0 comments on commit 185599d

Please sign in to comment.