-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (30 loc) · 799 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
31
32
33
34
35
36
37
38
# Use a lightweight Python image
FROM python:3.10-slim
# Install necessary tools
RUN apt-get update && apt-get install -y \
nano \
unzip \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PORT=7860
WORKDIR $HOME/app
# Install deta CLI and Python dependencies
RUN curl -fsSL https://get.deta.dev/cli.sh | sh
RUN pip install --no-cache-dir \
numpy \
plotly \
tensorflow \
streamlit
# Copy the application code to the container
COPY --chown=user . $HOME/app
# Expose the port used by Streamlit
EXPOSE $PORT
# Command to run the Streamlit app
CMD streamlit run --server.port ${PORT:-7860} app.py