-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
28 lines (18 loc) · 800 Bytes
/
Copy pathContainerfile
File metadata and controls
28 lines (18 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM python:slim
LABEL maintainer="https://github.com/soubinan"
WORKDIR /app
RUN apt-get update -y && apt-get upgrade -y && apt-get install wget curl -y && apt-get clean -y
RUN wget "https://github.com/coreos/butane/releases/latest/download/butane-x86_64-unknown-linux-gnu" -O /usr/bin/butane && \
chmod +x /usr/bin/butane
COPY requirements.txt requirements.txt
RUN pip install -U pip && \
pip install -r requirements.txt --no-cache-dir
COPY main.py main.py
ARG version=1.0.0
ENV API_VERSION=$version \
READ_APPEND_ONLY=false
EXPOSE 8000
HEALTHCHECK --interval=15s --timeout=5s --start-period=5s --retries=3 \
CMD curl -s --fail http://127.0.0.1:8000 || exit 1
ENTRYPOINT [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--use-colors"]
CMD ["--workers", "1"]