From b538761746ada6727f20123c902ec4f8670ac821 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 26 Mar 2020 18:20:44 +0100 Subject: [PATCH] run container as root for now since i want to realease this we will for now continue to run this as root inside the containerr. this can be fixed later, PR's welcome --- Dockerfile | 6 ------ boot.sh | 13 ------------- 2 files changed, 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0b182b27..76940ec4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,8 @@ RUN apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt- ENV PYTHONUNBUFFERED 1 EXPOSE 8080 -# Don't run container as root -RUN adduser -D recipes - RUN mkdir /opt/recipes -RUN chown recipes:recipes /opt/recipes WORKDIR /opt/recipes -COPY --chown=recipes:recipes . ./ RUN chmod +x boot.sh setup.sh RUN ln -s /opt/recipes/setup.sh /usr/local/bin/createsuperuser @@ -19,5 +14,4 @@ RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-de venv/bin/pip install -r requirements.txt --no-cache-dir &&\ apk --purge del .build-deps -USER recipes ENTRYPOINT ["/opt/recipes/boot.sh"] \ No newline at end of file diff --git a/boot.sh b/boot.sh index e1dc8f31..0605d78d 100644 --- a/boot.sh +++ b/boot.sh @@ -1,17 +1,4 @@ #!/bin/sh - -# Change ownership if needed -if [ ! -n "$(find staticfiles -user "$(id -u)" -print -prune -o -prune)" ] -then - echo "Changing ownership of staticfiles" - chown -R recipes:recipes staticfiles -fi -if [ ! -n "$(find mediafiles -user "$(id -u)" -print -prune -o -prune)" ] -then - echo "Changing ownership of mediafiles" - chown -R recipes:recipes mediafiles -fi - source venv/bin/activate echo "Updating database"