hathawayj commited on
Commit
1a64d85
·
1 Parent(s): 9b20efd
Files changed (5) hide show
  1. Dockerfile +11 -0
  2. README.md +8 -5
  3. docker-compose.yml +13 -0
  4. requirements.txt +5 -0
  5. streamlit.py +8 -0
Dockerfile ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+ EXPOSE 8501
3
+ WORKDIR /app
4
+ RUN apt-get update && apt-get install -y \
5
+ build-essential \
6
+ software-properties-common \
7
+ git \
8
+ && rm -rf /var/lib/apt/lists/*
9
+ COPY . /app
10
+ RUN pip3 install -r requirements.txt
11
+ ENTRYPOINT ["streamlit", "run", "streamlit.py", "--server.port=8501", "--server.address=0.0.0.0"]
README.md CHANGED
@@ -1,11 +1,14 @@
1
  ---
2
- title: ' Template Streamlit Docker'
3
- emoji: 🦀
4
- colorFrom: yellow
5
- colorTo: gray
6
  sdk: docker
7
  pinned: false
8
  license: apache-2.0
 
9
  ---
10
 
11
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
+ title: Streamlit Docker Template (BYUI)
3
+ emoji: 🐨
4
+ colorFrom: indigo
5
+ colorTo: red
6
  sdk: docker
7
  pinned: false
8
  license: apache-2.0
9
+ app_port: 8501
10
  ---
11
 
12
+ ## Streamlit Docker Template
13
+
14
+ This template allows us to develop on our local computer using Docker Desktop before we push to Hugging Face.
docker-compose.yml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.9'
2
+ services:
3
+ streamlit:
4
+ build:
5
+ dockerfile: Dockerfile
6
+ context: .
7
+ container_name: streamlit-example
8
+ cpus: 2
9
+ mem_limit: 2048m
10
+ ports:
11
+ - "8501:8501"
12
+ volumes:
13
+ - ".:/app:rw"
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ polars
2
+ pandas
3
+ streamlit
4
+ scikit-learn
5
+ plotly
streamlit.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import polars as pl
3
+
4
+ st.write("Here's our first attempt at using data to create a table:")
5
+ st.write(pl.DataFrame({
6
+ 'first column': [1, 2, 3, 4],
7
+ 'second column': [10, 20, 30, 40]
8
+ }))