How do I deploy a Streamlit app via Azure Container Apps?

Viewed 31

I am trying to deploy a Streamlit app via Docker on Azure Container Apps. This is what the docker file looks like:

FROM python:3.9

RUN mkdir /workdir
WORKDIR /workdir
COPY ./requirements.txt .

RUN pip install -r requirements.txt
COPY . .

EXPOSE 8080

CMD streamlit run --server.port 8080 --server.enableCORS false app.py

I tested it localy using this script:

# Build docker image
docker build . -t image123ABC

# Serve locally
docker run -p 8080:8080 image123ABC

Locally this works fine.

I deployed it to the Azure Container Registry and tried to create an Azure Container App from it, but it resulted in a page that never finishes loading.

Did I do something wrong?

1 Answers

I found the issue. It was the port. The Azure Container apps default to port 80. I changed the 8080 to just 80 in the docker file and it started working.

Related