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
This commit is contained in:
parent
913d858473
commit
b538761746
@ -4,13 +4,8 @@ RUN apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-
|
|||||||
ENV PYTHONUNBUFFERED 1
|
ENV PYTHONUNBUFFERED 1
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
# Don't run container as root
|
|
||||||
RUN adduser -D recipes
|
|
||||||
|
|
||||||
RUN mkdir /opt/recipes
|
RUN mkdir /opt/recipes
|
||||||
RUN chown recipes:recipes /opt/recipes
|
|
||||||
WORKDIR /opt/recipes
|
WORKDIR /opt/recipes
|
||||||
COPY --chown=recipes:recipes . ./
|
|
||||||
RUN chmod +x boot.sh setup.sh
|
RUN chmod +x boot.sh setup.sh
|
||||||
RUN ln -s /opt/recipes/setup.sh /usr/local/bin/createsuperuser
|
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 &&\
|
venv/bin/pip install -r requirements.txt --no-cache-dir &&\
|
||||||
apk --purge del .build-deps
|
apk --purge del .build-deps
|
||||||
|
|
||||||
USER recipes
|
|
||||||
ENTRYPOINT ["/opt/recipes/boot.sh"]
|
ENTRYPOINT ["/opt/recipes/boot.sh"]
|
13
boot.sh
13
boot.sh
@ -1,17 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/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
|
source venv/bin/activate
|
||||||
|
|
||||||
echo "Updating database"
|
echo "Updating database"
|
||||||
|
Loading…
Reference in New Issue
Block a user