Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Mar 23, 2024
1 parent b888b4a commit 2940fdd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ FROM --platform=$BUILDPLATFORM python:3.12-bookworm AS builder

ENV POETRY_VERSION=1.8.2

# Install Node.js v18
RUN apt-get update && apt-get install -y curl=7.88.1-10+deb12u5 && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
# 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 && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nsolid

# Install Poetry
Expand All @@ -19,7 +19,6 @@ ENV POETRY_NO_INTERACTION=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

WORKDIR /opt/invenio

COPY pyproject.toml poetry.lock ./
RUN touch README.md
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
Expand All @@ -40,22 +39,25 @@ ENV VIRTUAL_ENV=/opt/invenio/.venv \

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

WORKDIR /opt/invenio

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

COPY ./site ./site
COPY ./templates ${INVENIO_INSTANCE_PATH}/templates
COPY ./app_data ${INVENIO_INSTANCE_PATH}/app_data
COPY ./translations ${INVENIO_INSTANCE_PATH}/translations
COPY --from=builder ${INVENIO_INSTANCE_PATH}/static ${INVENIO_INSTANCE_PATH}/static
COPY --from=builder ${INVENIO_INSTANCE_PATH}/assets ${INVENIO_INSTANCE_PATH}/assets

# Create user
# Create user and set permissions
ENV INVENIO_USER_ID=1000
RUN adduser invenio --uid ${INVENIO_USER_ID} --gid 0

# Set folder permissions
# RUN chgrp -R 0 ${WORKDIR} && \
# chmod -R g=u ${WORKDIR} && \
# chown -R invenio:root ${WORKDIR}
# RUN adduser invenio --uid ${INVENIO_USER_ID} --gid 0 --no-create-home && \
# chgrp -R +0 ${WORKDIR}
# # chmod -R g=u ${WORKDIR} && \
# # chown -R invenio:root ${WORKDIR}

USER invenio
# USER invenio
EXPOSE 8080
CMD ["gunicorn", "-b", "0.0.0.0:8080", "invenio_app.wsgi"]

0 comments on commit 2940fdd

Please sign in to comment.