Improve docker image size
This commit is contained in:
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
app/tests
|
||||||
11
Dockerfile
11
Dockerfile
@@ -1,13 +1,16 @@
|
|||||||
FROM python:3.11.2
|
FROM python:3.11.2-slim
|
||||||
|
|
||||||
COPY /poetry.lock /poetry.lock
|
COPY poetry.lock pyproject.toml ./
|
||||||
COPY /pyproject.toml /pyproject.toml
|
COPY /app /app
|
||||||
COPY ./app /app
|
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
|
# Install requirements
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get -y dist-upgrade
|
RUN apt-get -y dist-upgrade
|
||||||
RUN apt-get -y install python3-pip curl
|
RUN apt-get -y install python3-pip curl
|
||||||
|
|
||||||
|
# Install poetry and dependencies
|
||||||
RUN curl -sSL https://install.python-poetry.org | python3 -
|
RUN curl -sSL https://install.python-poetry.org | python3 -
|
||||||
ENV PATH=/root/.local/bin:$PATH
|
ENV PATH=/root/.local/bin:$PATH
|
||||||
RUN poetry install
|
RUN poetry install
|
||||||
|
|||||||
Reference in New Issue
Block a user