forked from evidentlyai/evidently
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (39 loc) · 1.21 KB
/
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
FROM python:3.10-slim
# Install system packages
RUN apt-get update && \
apt-get install -y \
apt-transport-https \
build-essential \
cmake \
curl \
gcc \
g++ \
git \
libpq-dev \
python3-dev \
tree \
sudo \
unzip \
wget \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir --ignore-installed -r requirements.txt
# Configure default user name and ID
ARG USER_ID="1000"
ENV USER_ID=${USER_ID}
ENV USER_NAME="fastapi"
RUN useradd -m ${USER_NAME} -u ${USER_ID} && \
echo "${USER_NAME}:${USER_NAME}" | chpasswd ${USER_NAME} && \
echo "${USER_NAME} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${USER_NAME} && \
chmod 0440 /etc/sudoers.d/${USER_NAME} && \
chown -R ${USER_NAME} /home
USER ${USER_NAME}
# Configure workdir
WORKDIR /home/evidently-fastapi
# Configure PYTHONPATH environment variable
ENV PYTHONPATH=/home/evidently-fastapi
# Launch uvicorn server with FastAPI application on start up
CMD uvicorn app:app --app-dir fastapi --reload --host 0.0.0.0 --port 5000