Update docker image
This commit is contained in:
parent
01c496ec2e
commit
272ec7acc6
4 changed files with 24 additions and 109 deletions
36
Dockerfile
36
Dockerfile
|
|
@ -1,36 +1,46 @@
|
|||
# syntax=docker/dockerfile:1.4
|
||||
FROM python:3.10.4-slim-bullseye
|
||||
|
||||
LABEL org.opencontainers.image.title="GreatAI package wrapper container"
|
||||
LABEL org.opencontainers.image.title="GreatAI package wrapper image"
|
||||
LABEL org.opencontainers.image.vendor="ScoutinScience B.V."
|
||||
LABEL org.opencontainers.image.authors="andras@schmelczer.dev"
|
||||
LABEL org.opencontainers.image.source="https://github.com/schmelczer/great-ai"
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
ENV ENVIRONMENT=production
|
||||
EXPOSE 6060
|
||||
|
||||
# curl is needed for the healthcheck
|
||||
# build-essentials are needed for building packages
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt update &&\
|
||||
apt install curl build-essential -y &&\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
apt install curl build-essential -y &&\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /dependencies
|
||||
COPY . great_ai
|
||||
RUN python3 -m pip --no-cache-dir install --upgrade pip &&\
|
||||
pip install --no-cache-dir ./great_ai &&\
|
||||
rm -rf great_ai
|
||||
pip install --no-cache-dir ./great_ai &&\
|
||||
rm -rf great_ai
|
||||
|
||||
HEALTHCHECK \
|
||||
--interval=10s \
|
||||
--timeout=60s \
|
||||
--start-period=30s \
|
||||
--retries=5 \
|
||||
CMD [ "curl", "--fail", "http://localhost:6060/health" ]
|
||||
--interval=10s \
|
||||
--timeout=60s \
|
||||
--start-period=30s \
|
||||
--retries=5 \
|
||||
CMD [ "curl", "--fail", "http://localhost:6060/health" ]
|
||||
|
||||
WORKDIR /app
|
||||
VOLUME /app
|
||||
COPY <<EOF hello_world.py
|
||||
from great_ai import GreatAI
|
||||
\
|
||||
@GreatAI.create
|
||||
def hello_world(name: str) -> str:
|
||||
"""Learn more about GreatAI at https://great-ai.scoutinscience.com"""
|
||||
return f"Hello {name}!"
|
||||
EOF
|
||||
|
||||
COPY docs/hello_world.py .
|
||||
EXPOSE 6060
|
||||
VOLUME /app
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/python3", "-m", "great_ai"]
|
||||
CMD ["hello_world.py"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue