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?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.