Monday, June 24, 2024

Dockerfile for MageAI

 Dockerfile for MageAI


MageAI Document Link - https://docs.mage.ai/getting-started/setup#docker-compose-template


    You can use above link to run MageAI with docker-compose and if you end up on error like "Illegal Instruction" then you will have to use custom dockerfile.

1] Create Dockerfile

# mkdir mageai; cd mageai

# vi Dockerfile
FROM mageai/mageai:latest
RUN pip uninstall -y polars && \
    pip install "polars-lts-cpu>=0.19.0,<0.19.2"
EXPOSE 6789
CMD ["/app/run_app.sh"]

2] Save above dockerfile and build docker image

# docker build -t localmageai .

3] Run docker container on port 6789

# docker run -d -p 6789:6789 --name localmageai locamageai:latest

4] Open browser and try to access http://localhost:6789.  You should be able to run MageAI UI successfully.

No comments: