diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae412d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +env/ \ No newline at end of file diff --git a/.mollier/application.json b/.mollier/application.json new file mode 100644 index 0000000..b213b2c --- /dev/null +++ b/.mollier/application.json @@ -0,0 +1 @@ +{"id":"d9d094de-9912-4ed4-b4f4-e055f32b2cf3","updated":"2022-08-30T17:29:21.405701","stage":"sandbox","tenant_id":"4a31a0c5-68a7-44bb-baea-aa6d122e1b95","name":"streamlit"} \ No newline at end of file diff --git a/.mollier/frpc.ini b/.mollier/frpc.ini new file mode 100644 index 0000000..8d709d6 --- /dev/null +++ b/.mollier/frpc.ini @@ -0,0 +1,11 @@ +[common] +server_addr = proxy.mollier.dev +server_port = 7000 + +[sandbox-482d651d-d7af-4bc9-b449-bcf4b820bbfd] +type = tcp +local_ip = 127.0.0.1 +local_port = 8501 +remote_port = 10000 +use_encryption = true +use_compression = true diff --git a/.mollier/sandbox.json b/.mollier/sandbox.json new file mode 100644 index 0000000..bc89bc4 --- /dev/null +++ b/.mollier/sandbox.json @@ -0,0 +1 @@ +{"id": "482d651d-d7af-4bc9-b449-bcf4b820bbfd", "updated": "2022-09-01T14:20:39.342440", "stage": "sandbox", "proxy_port": 10000, "connection": "inbound", "resource": "custom", "application_id": "d9d094de-9912-4ed4-b4f4-e055f32b2cf3"} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d62b00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.10 +RUN mkdir /opt/mollier +COPY . /opt/mollier +WORKDIR /opt/mollier +RUN pip install --upgrade pip +RUN pip install -e git+https://guillem:4373375038e09b91e5282e72342fb8d369cef8f6@git.guillemborrell.es/mollier/mollier.git@main#egg=mollier +RUN pip install -r requirements.txt +RUN useradd -m --system --user-group mollier +RUN chown -R mollier:mollier /opt/mollier +USER mollier +CMD ph serve "streamlit run hello.py" \ No newline at end of file diff --git a/README.md b/README.md index e435c1e..e969d75 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ -# streamlit +# mollier/streamlit -Streamlit application running on mollier \ No newline at end of file +Streamlit application running on mollier + +## Install and run locally + +ˋˋˋ +pip install -r requirements.txt +ph serve "streamlit run hello.py +ˋˋˋ + +## Build and run a container image + +ˋˋˋ +docker build . -t mollier-streamlit +docker run mollier-streamlit +ˋˋˋ \ No newline at end of file diff --git a/hello.py b/hello.py new file mode 100644 index 0000000..f1baa30 --- /dev/null +++ b/hello.py @@ -0,0 +1,3 @@ +import streamlit as st + +st.write("Hello from streamlit") \ No newline at end of file diff --git a/mollier.json b/mollier.json new file mode 100644 index 0000000..83ece1e --- /dev/null +++ b/mollier.json @@ -0,0 +1,6 @@ +{ + "runtime": "docker", + "layout": "container", + "port": 8501, + "entrypoint": "entrypoint.sh" +} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..79402f2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +streamlit +mollier \ No newline at end of file