use ARG ENV to chown /code for prod to allow gunicorn logs to work in prod as non-root user
This commit is contained in:
@@ -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 && \
|
||||
|
||||
Reference in New Issue
Block a user