therafk/app-st
App to test kubernetes flow from ingress to DB and back
10
App:
FROM python:3.10-slim
WORKDIR /app
RUN pip3 install streamlit
RUN pip3 install mysql-connector-python #MySQL8 compatible
COPY main.py .
EXPOSE 8501
ENTRYPOINT ["streamlit","run","main.py","--server.port=8501","--server.address=0.0.0.0"]
Creds:
streamlit_host = os.environ.get('ST_HOST')
streamlit_password = os.environ.get('ST_PASSWORD')
Need a db:
CREATE USER st_user@'%' IDENTIFIED by '<PASS>';
GRANT ALL ON st_crud_db.st_users TO st_user@'%';
ᅳᅳᅳᅳᅳ
CREATE DATABASE IF NOT EXISTS st_crud_db;
USE st_crud_db;
CREATE TABLE IF NOT EXISTS `st_users` (
`id` tinyint UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(64) DEFAULT NULL,
`email` varchar(64) DEFAULT NULL,
PRIMARY KEY (`id`));
ᅳᅳᅳᅳᅳ
INSERT INTO st_users(name,email) VALUES("test1", "test1@example.com");
SELECT * FROM st_crud_db.st_users;
docker pull therafk/app-st