diff --git a/Dockerfile b/Dockerfile index 8dda96e9..5e22b46b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,19 @@ FROM python:3.8-alpine +#Install all dependencies. RUN apk add --no-cache postgresql-libs gettext zlib libjpeg libxml2-dev libxslt-dev + +#Print all logs without buffering it. ENV PYTHONUNBUFFERED 1 + +#This port will be used by gunicorn. EXPOSE 8080 +#Create app dir and install requirements. RUN mkdir /opt/recipes WORKDIR /opt/recipes -COPY . ./ -RUN chmod +x boot.sh + +COPY requirements.txt ./ RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev libressl-dev libffi-dev cargo && \ python -m venv venv && \ @@ -15,4 +21,7 @@ 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 &&\ apk --purge del .build-deps +#Copy project and execute it. +COPY . ./ +RUN chmod +x boot.sh ENTRYPOINT ["/opt/recipes/boot.sh"] \ No newline at end of file