Create dockerfile
This commit is contained in:
parent
a4fa69eb0e
commit
01cbe76aa0
5 changed files with 29 additions and 45 deletions
33
Dockerfile
33
Dockerfile
|
|
@ -1,27 +1,26 @@
|
|||
FROM python:3.10.4-slim-bullseye
|
||||
|
||||
LABEL org.opencontainers.image.title="GreatAI package wrapper container"
|
||||
LABEL org.opencontainers.image.vendor="ScoutinScience B.V."
|
||||
LABEL org.opencontainers.image.authors="andras@schmelczer.dev"
|
||||
LABEL org.opencontainers.image.source="https://github.com/ScoutinScience/great_ai"
|
||||
|
||||
ENV ENVIRONMENT production
|
||||
EXPOSE 6060
|
||||
|
||||
ARG ENTRYPOINT main.py
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update &&\
|
||||
apt-get install curl -y &&\
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update &&\
|
||||
apt 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 . great_ai
|
||||
RUN pip3 install --no-cache-dir ./great_ai &&\
|
||||
rm -rf great_ai
|
||||
|
||||
# COPY requirements.txt ./
|
||||
# RUN pip install --no-cache-dir --requirement requirements.txt
|
||||
|
||||
COPY . .
|
||||
RUN rm -rf great_ai
|
||||
|
||||
EXPOSE 6060
|
||||
RUN pip3 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
|
||||
|
||||
HEALTHCHECK --interval=60s --timeout=60s --start-period=90s --retries=5 CMD [ "curl", "--fail", "http://localhost:6060/health" ]
|
||||
|
||||
CMD ["great_ai", "$ENTRYPOINT"]
|
||||
WORKDIR /app
|
||||
VOLUME /app
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "python3", "-m", "great_ai"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue