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"