1

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?

MYK
  • 1,988
  • 7
  • 30
  • I think you need an `ENTRYPOINT` at the end of your dockerfile as well. See [the dockerfile section](https://docs.streamlit.io/knowledge-base/tutorials/deploy/docker) from the documentation. – Nick Sep 13 '22 at 10:35
  • I tried this, but still not working. – MYK Sep 13 '22 at 11:08
  • I get a request timeout if I try to ping the IP address – MYK Sep 13 '22 at 11:09
  • It may be a networking issue then. Is the `HTTP Ingress` enabled on azure? – Nick Sep 13 '22 at 12:15
  • 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. – MYK Sep 13 '22 at 13:59

1 Answers1

1

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.

MYK
  • 1,988
  • 7
  • 30