-
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathdocker.Dockerfile
59 lines (42 loc) · 1.56 KB
/
docker.Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.10
MAINTAINER [email protected]
RUN apt-get update && apt-get install -y --no-install-recommends git && apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/*
# Virtual env
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:/src:$PATH"
# update pip
RUN /usr/local/bin/python3 -m pip install --upgrade pip
RUN pip install wheel
# set the working directory in the container
RUN mkdir src/
WORKDIR /src
## Copy application
COPY app app/
# Remove test page
RUN rm -rf app/tracker/index.html
RUN rm -rf app/tracker/index.css
COPY uix uix/
# Prepare in CD from REPO tracardi/deferpy
# +:defer => defer
COPY defer defer/
# Prepare in CD from REPO tracardi/doumentation
# +:docs => docs
COPY docs docs/
# Prepare in CD - from tracardi/tracardi
# +:. => tracardi
COPY tracardi/tracardi tracardi
RUN pip --default-timeout=240 install -r tracardi/requirements.txt
RUN pip --default-timeout=240 install -r app/requirements.txt
RUN pip --default-timeout=240 install -r defer/requirements.txt
# Start up
ENV VARIABLE_NAME="application"
# Set a default value for TAG_VERSION
ARG IMAGE_TAG=unknown
ENV IMAGE_TAG=${IMAGE_TAG}
ENV SERVER_LOGGING_LEVEL=info
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH="$VIRTUAL_ENV/bin:/src:$PYTHONPATH"
WORKDIR /src
#CMD ["uvicorn", "app.main:application", "--proxy-headers", "--host", "0.0.0.0", "--port", "80", "--log-level", "${SERVER_LOGGING_LEVEL}"]
CMD ["sh", "-c", "uvicorn app.main:application --proxy-headers --host 0.0.0.0 --port 80 --log-level $SERVER_LOGGING_LEVEL"]