initial commit

This commit is contained in:
iwpnd 2020-01-29 13:25:26 +01:00
commit 558e63b76f
8 changed files with 207 additions and 0 deletions

10
.dockerignore Normal file
View File

@ -0,0 +1,10 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
.env*
.cache
*.log
.git*
scripts

137
.gitignore vendored Normal file
View File

@ -0,0 +1,137 @@
.python-version
/.vscode/
*.code-workspace
todo.txt
*.ipynb
.env
.DS_Store
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/

23
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
args: [--unsafe]
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-ast
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
hooks:
- id: flake8
args: ["--ignore=E203,W503,E501"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.4.0
hooks:
- id: reorder-python-imports
language_version: python3

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM python:3.7
WORKDIR /usr/src/app
# dont write pyc files
# dont buffer to stdout/stderr
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt /usr/src/app/requirements.txt
# dependencies
RUN pip install --upgrade pip setuptools wheel \
&& pip install -r requirements.txt \
&& rm -rf /root/.cache/pip
COPY ./ /usr/src/app

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# streamlit-docker-example
Example on how to run and develop a streamlit application inside docker.

5
app/main.py Normal file
View File

@ -0,0 +1,5 @@
import streamlit as st
st.title("Hi from streamlit inside docker")
st.write("looks like this works properly.")
st.write("What happens if you change the file?")

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: '3.7'
services:
api:
build: ./
command: streamlit run app/main.py --server.port 8501
volumes:
- ./:/usr/src/app
ports:
- 8501:8501
image: yourstreamlitapp:latest

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
streamlit