From 063508c97294d59d1edb42e8129debbc3e88b809 Mon Sep 17 00:00:00 2001 From: Deko Date: Sat, 11 Mar 2023 00:43:41 +0100 Subject: [PATCH] Improve docker image size --- .dockerignore | 1 + Dockerfile | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..271b66b --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +app/tests diff --git a/Dockerfile b/Dockerfile index 52f424a..f0e3f24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,16 @@ -FROM python:3.11.2 +FROM python:3.11.2-slim -COPY /poetry.lock /poetry.lock -COPY /pyproject.toml /pyproject.toml -COPY ./app /app +COPY poetry.lock pyproject.toml ./ +COPY /app /app WORKDIR / + +# Install requirements RUN apt-get update RUN apt-get -y dist-upgrade RUN apt-get -y install python3-pip curl + +# Install poetry and dependencies RUN curl -sSL https://install.python-poetry.org | python3 - ENV PATH=/root/.local/bin:$PATH RUN poetry install