- Dockerfile
- contains instructions on how the docker image should be created
- building the image is done using the
docker build -t $IMAGE_NAME:$IMAGE_VERSION .
command- e.g.
docker build -t streamlit_azure:v1 .
- more info inside the file
- shouldn't need any changes
- e.g.
- environment.yml
- used to initialise the conda environment and install dependencies
- shoudln't need any changes
- deployment.yml
- information for azure deployment
- change password on line 21 with the one you get using these commands
az acr login -n bpdsregistry
az acr update -n bpdsregistry --admin-enabled true
az acr credential show --name bpdsregistry
- The
dnsNameLabel
on line 30 refers to what you would like your domain name to be โ this app should be able to be accessed usingstreamlit_azure.westus.azurecontainer.io
after it's deployed.
- nginx.conf
- used to configure nginx
server name
should be changed in casednsNameLabel
is changed indeployment.yml
- format is
dnsNameLabel.location.azurecontainer.io
wherednsNameLabel
andlocation
are the same as indeployment.yml
- format is
- run.sh
- starts
nginx
and the streamlit app - needs to
cd
insideStreamlit-App
because otherwise the custom theme insideStreamlit-App/.streamlit/config.toml
is not applied. server.port
andserver.address
params are specified for reproducibility.
- starts
In order to test the Docker image locally you can run the following commands
- docker build -t streamlit_azure:v1 .
- to create an image called
streamlit_azure
with versionv1
- to create an image called
- docker run -p 8501:8501 streamlit_azure:v1
- creates a container with the
streamlit_azure:v1
image and starts it. -p
parameters maps a local port to the container port (first port is local, second is of container)
- creates a container with the
- Open a browser window and access
localhost:8501
- the streamlit app should be here.
az acr login -n bpdsregistry
docker build -t azure_demo:v1 .
docker tag streamlit_azure:v1 bpdsregistry.azurecr.io/streamlit_azure:v1
docker push bpdsregistry.azurecr.io/streamlit_azure:v1
az container create --resource-group bpds_poc --name streamlit_azure -f deployment.yml
The full length tutorial is at this link.