-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (24 loc) · 816 Bytes
/
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
FROM python:3.9-slim
# Set the XDG_RUNTIME_DIR environment variable
ENV XDG_RUNTIME_DIR=/tmp/runtime-root
# Combine RUN commands to reduce layers and install only necessary packages
RUN mkdir -p /tmp/runtime-root && chmod 777 /tmp/runtime-root && \
apt-get update && \
apt-get install -y --no-install-recommends \
wkhtmltopdf \
xfonts-75dpi \
xfonts-base \
fonts-dejavu \
graphviz \
wget \
gnupg2 && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir --upgrade pip
WORKDIR /app
# Copy only requirements first to leverage cache
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . /app/
EXPOSE 8502
CMD ["streamlit", "run", "app.py", "--server.port=8502", "--server.address=0.0.0.0"]