add google, tweak to be a bit more robust
This commit is contained in:
27
Dockerfile
27
Dockerfile
@@ -1,29 +1,28 @@
|
|||||||
FROM python
|
FROM python:latest
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# declare var
|
# declare var
|
||||||
ARG ENV
|
ARG ENV
|
||||||
ARG BOOK_UID
|
ARG BOOK_UID
|
||||||
ARG BOOK_GID
|
ARG BOOK_GID
|
||||||
|
|
||||||
RUN groupadd -g ${BOOK_GID} pybook && useradd -m -u ${BOOK_UID} -g ${BOOK_GID} pybook
|
RUN apt-get update && apt-get install -y sudo && apt-get -y upgrade
|
||||||
# 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 wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
|
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
|
||||||
apt-get install -f -y && \
|
apt-get install -f -y && \
|
||||||
apt-get install sudo && \
|
rm -f ./google-chrome-stable_current_amd64.deb && \
|
||||||
apt-get upgrade -y && \
|
|
||||||
rm ./google-chrome-stable_current_amd64.deb && \
|
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
RUN pip3 install --upgrade pip
|
# just copy requirements for now, helps with build optimisation
|
||||||
RUN pip3 install -U -r requirements.txt
|
COPY requirements.txt .
|
||||||
|
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
|
||||||
|
|
||||||
|
RUN groupadd -g ${BOOK_GID} pybook && useradd -m -u ${BOOK_UID} -g ${BOOK_GID} pybook
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
# in prod, /code will be owned by root and gunicorn logs wont work, so chg to pybook
|
||||||
|
RUN chown -R pybook:pybook /code
|
||||||
RUN cat /dev/urandom | head -c 50 | md5sum | head -c 32 > /code/.sk
|
RUN cat /dev/urandom | head -c 50 | md5sum | head -c 32 > /code/.sk
|
||||||
RUN chmod 600 .sk
|
RUN chmod 600 .sk
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
Reference in New Issue
Block a user