Skip to content
Snippets Groups Projects
Verified Commit 477187dc authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

build: clean-up Dockerfile

Closes: #184
parent 4c8bb929
No related branches found
No related tags found
No related merge requests found
Pipeline #7522 passed
...@@ -11,10 +11,14 @@ WORKDIR /app ...@@ -11,10 +11,14 @@ WORKDIR /app
COPY poetry.lock pyproject.toml /app/ COPY poetry.lock pyproject.toml /app/
RUN apt-get update && apt-get install -y curl gcc graphviz ldap-utils libldap2-dev libmagic1 libsasl2-dev make RUN apt-get update && \
RUN python -m venv ${POETRY_HOME} apt-get install --yes --no-install-recommends curl gcc graphviz ldap-utils libldap2-dev \
RUN pip install poetry==1.7.0 libmagic1 libsasl2-dev make && \
RUN poetry install python -m venv ${POETRY_HOME} && \
pip install --no-cache-dir poetry==1.7.1 && \
poetry install && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
EXPOSE 8000 EXPOSE 8000
...@@ -24,25 +28,23 @@ COPY . . ...@@ -24,25 +28,23 @@ COPY . .
VOLUME ["/app"] VOLUME ["/app"]
# run with Django's development server # run with Djangos development server
CMD ["run.dev"] CMD ["run.dev"]
FROM base AS prod FROM base AS prod
COPY . . COPY . .
RUN adduser --home /app --no-create-home --system --uid ${AURA_UID} --group app RUN adduser --home /app --no-create-home --system --uid ${AURA_UID} --group app && \
RUN mkdir -p /app/logs # static and site_media are named volumes which we use across multiple
# static/admin and site_media are named volumes which we use across multiple # containers. We therefore create them here and set the permissions right away
# containers. We therefore create them here and set the permissions right away # since named volumes otherwise create these directories themself as the root
# since named volumes otherwise create these directories themself as the root # user.
# user. mkdir -p /app/{logs,static,site_media} && \
  • Owner

    We used to create /app/static/admin but now only /app/static. I will check if this leads to errors. Also see discussion at aura#308 (closed).

  • Please register or sign in to reply
RUN mkdir -p /app/static/admin chown -R app:app /app
RUN mkdir -p /app/site_media
# set permissions
RUN chown -R app:app /app
USER app USER app
# run with gunicorn # run with gunicorn
CMD ["run.prod"] CMD ["run.prod"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment