Skip to content

Commit

Permalink
Correctly initialize uploads dir in Dockerfile (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
danjov authored Nov 20, 2023
2 parents 8649e87 + 962545c commit b608d84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS final
ENV HOME=/app
ENV TZ=Europe/Zurich
ENV ASPNETCORE_ENVIRONMENT=Production
ENV GEOCOP_UPLOADS_DIR=/uploads
WORKDIR ${HOME}

# Install missing packages
Expand All @@ -56,9 +57,11 @@ RUN \
# Add non-root user
RUN \
useradd --uid 941 --user-group --home $HOME --shell /bin/bash abc && \
usermod --groups users abc
usermod --groups users abc && \
mkdir -p $GEOCOP_UPLOADS_DIR

EXPOSE 80
VOLUME $GEOCOP_UPLOADS_DIR

# Set default locale
ENV LANG=C.UTF-8
Expand Down
6 changes: 6 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/bash
set -e

# Change owner for our uploads folder
echo -n "Fix permissions for mounted volumes ..." && \
chown -R abc:abc $GEOCOP_UPLOADS_DIR && \
echo "done!"


echo "
--------------------------------------------------------------------------
http proxy: ${PROXY:-no proxy set}
Expand Down

0 comments on commit b608d84

Please sign in to comment.