diff --git a/Dockerfile b/Dockerfile index 16aad9c..00f6ba8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,15 @@ WORKDIR /code COPY . . # declare var +ARG ENV ARG BOOK_UID ARG BOOK_GID -WORKDIR /code RUN groupadd -g ${BOOK_GID} pybook && useradd -m -u ${BOOK_UID} -g ${BOOK_GID} pybook +# in prod, /code will be owned by root and gunicorn logs wont work, so chg to pybook +RUN if [ "$ENV" = "production" ]; then \ + chown -R pybook:pybook /code; \ + fi RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN apt-get update && \