Update dockerfiles

This commit is contained in:
Andras Schmelczer 2022-05-28 14:52:29 +02:00
parent 5bd7e58ed8
commit 824fd42982
3 changed files with 9 additions and 25 deletions

View file

@ -1,27 +0,0 @@
FROM python:3.10.4-alpine3.16
ENV ENVIRONMENT production
ARG ENTRYPOINT main.py
WORKDIR /app
RUN apt-get update &&\
apt-get install curl -y &&\
rm -rf /var/lib/apt/lists/*
RUN 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 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 . .
RUN rm -rf great_ai
EXPOSE 6060
HEALTHCHECK --interval=60s --timeout=60s --start-period=90s --retries=5 CMD [ "curl", "--fail", "http://localhost:6060/health" ]
CMD ["great_ai", "$ENTRYPOINT"]

View file

@ -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"]