diff --git a/flask/Dockerfile b/flask/Dockerfile index e6e887a..9d32a3c 100644 --- a/flask/Dockerfile +++ b/flask/Dockerfile @@ -1,38 +1,3 @@ -########### -# BUILDER # -########### - -# pull official base image -FROM python:3 as builder - -# set work directory -WORKDIR /usr/src/app - -# set environment variables -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 - -# install system dependencies -RUN apt-get update && \ - apt-get install -y --no-install-recommends gcc - -# lint -RUN pip install --upgrade pip -RUN pip install flake8 -COPY . /usr/src/app/ -#RUN flake8 --ignore=E501,F401 . - -# install python dependencies -COPY ./requirements.txt . -RUN --mount=type=cache,target=/root/.cache \ - pip install --wheel-dir /usr/src/app/wheels -r requirements.txt - - -######### -# FINAL # -######### - -# pull official base image FROM python:3 # create directory for the app user @@ -47,11 +12,10 @@ RUN mkdir $APP_HOME WORKDIR $APP_HOME # install dependencies -RUN apt-get update && apt-get install -y --no-install-recommends netcat-openbsd -COPY --from=builder /usr/src/app/wheels /wheels -COPY --from=builder /usr/src/app/requirements.txt . -RUN pip install --upgrade pip -RUN pip install --no-cache /wheels/* +RUN apt-get update && apt-get install -y --no-install-recommends netcat-openbsd gcc + +COPY ./requirements.txt . +RUN pip install -r requirements.txt # copy entrypoint.sh COPY ./entrypoint.sh $APP_HOME @@ -66,4 +30,5 @@ RUN chown -R app:app $APP_HOME USER app # run entrypoint.sh -ENTRYPOINT ["/home/app/web/entrypoint.sh"] +ENTRYPOINT ["./entrypoint.sh"] +