create dashboard docker container to be deployed on AWS

I created a Dash dasboard that I want to deploy on AWS.

the tree I use is the following

app = dash.Dash(__name__)

app.scripts.config.serve_locally = True
app.css.config.serve_locally = True
...
...
some plots
...
if __name__ == '__main__':


    app.run_server()

This dashboard runs locally

I created this Dockerfile

FROM python:3.7-slim
# continuumio/miniconda3
WORKDIR /usr/src/app

COPY ./somefile.csv /usr/src/app/somefile.csv
COPY ./requirements.txt /tmp/ 
COPY ./app /usr/src/app
RUN apt update 
    && apt-get install -y libglib2.0-0 libsm6 libxrender1 libxext6 libgl1-mesa-dev

RUN pip install --no-cache-dir -r /tmp/requirements.txt



# ENTRYPOINT [ "python3" ]
CMD [ "python","application.py" ]


EXPOSE 8080

and then i build the image

docker build -t tp_dashboard .

If then I go inside the container

 docker container run -it tp_dashboard bash

and run the application.

I cannot access the dashboard on the browser

what is wrong?

If then I push the image to AWS ECR and then create a Fargate Cluster I also cannot access the dashboard.

Source: Docker Questions

LEAVE A COMMENT