From 824fd4298202b101dd43c04662867250b34d4d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Schmelczer?= Date: Sat, 28 May 2022 14:52:29 +0200 Subject: [PATCH] Update dockerfiles --- .dockerignore | 6 ++++++ examples/simple/Dockerfile => Dockerfile | 6 +++--- examples/simple/Dockerfile.development | 22 ---------------------- 3 files changed, 9 insertions(+), 25 deletions(-) create mode 100644 .dockerignore rename examples/simple/Dockerfile => Dockerfile (82%) delete mode 100644 examples/simple/Dockerfile.development diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ccbef6a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.venv +.env +**/.cache +.git +**/__pycache__ +.dockerignore diff --git a/examples/simple/Dockerfile b/Dockerfile similarity index 82% rename from examples/simple/Dockerfile rename to Dockerfile index 27c5f2a..a2156d7 100644 --- a/examples/simple/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10.4-alpine3.16 +FROM python:3.10.4-slim-bullseye ENV ENVIRONMENT production @@ -14,8 +14,8 @@ RUN pip install --no-cache-dir en-core-web-sm@https://github.com/explosion/spacy COPY great_ai great_ai RUN pip install --no-cache-dir ./great_ai -COPY requirements.txt ./ -RUN pip install --no-cache-dir --requirement requirements.txt +# COPY requirements.txt ./ +# RUN pip install --no-cache-dir --requirement requirements.txt COPY . . RUN rm -rf great_ai diff --git a/examples/simple/Dockerfile.development b/examples/simple/Dockerfile.development deleted file mode 100644 index 220447e..0000000 --- a/examples/simple/Dockerfile.development +++ /dev/null @@ -1,22 +0,0 @@ -FROM python:3.10.4-slim-bullseye - -ENV ENVIRONMENT development - -VOLUME /app -WORKDIR /app - -RUN apt-get update &&\ - apt-get install build-essential -y &&\ - rm -rf /var/lib/apt/lists/* - -RUN python3 -m pip install --no-cache-dir --upgrade pip &&\ - python3 -m pip install --no-cache-dir en-core-web-sm@https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.3.0/en_core_web_sm-3.3.0-py3-none-any.whl - -COPY requirements.txt ./ -RUN python3 -m pip install --no-cache-dir -r requirements.txt - -EXPOSE 5000 - -VOLUME /dependencies - -CMD ["/bin/bash", "-c", "python3 -m pip install -e /dependencies/sus && python3 -m uvicorn --reload --host 0.0.0.0 --port 5000 main:app"]