-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (20 loc) · 1.14 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
# This sets up the container with Python 3.10 installed.
FROM python:3.10-slim
# This copies everything in your current directory to the /app directory in the container.
COPY . /app
# This sets the /app directory as the working directory for any RUN, CMD, ENTRYPOINT, or COPY instructions that follow.
WORKDIR /app
# This runs pip install for all the packages listed in your requirements.txt file.
RUN pip install -r requirements.txt
# This tells Docker to listen on port 80 at runtime. Port 80 is the standard port for HTTP.
EXPOSE 80
# This command creates a .streamlit directory in the home directory of the container.
RUN mkdir ~/.streamlit
# This copies your Streamlit configuration file into the .streamlit directory you just created.
RUN cp config.toml ~/.streamlit/config.toml
# Similar to the previous step, this copies your Streamlit credentials file into the .streamlit directory.
RUN cp credentials.toml ~/.streamlit/credentials.toml
# This sets the default command for the container to run the app with Streamlit.
ENTRYPOINT ["streamlit", "run"]
# This command tells Streamlit to run your app.py script when the container starts.
CMD ["app.py"]