diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e650bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM ubuntu:latest + +COPY . ./app +WORKDIR /app + +RUN apt update; apt install -y wget lsb-release software-properties-common gnupg curl ca-certificates + +RUN wget -qO- https://apt.llvm.org/llvm.sh | bash -s -- 21 +RUN apt install -y libmlir-21-dev mlir-21-tools + +RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - +RUN apt install -y nodejs +RUN npm install + +RUN add-apt-repository -y ppa:deadsnakes/ppa; apt install -y python3-pip python3.11-venv + +RUN python3.11 -m venv mlir_venv + +RUN mlir_venv/bin/pip install --upgrade pip +RUN mlir_venv/bin/pip install --pre torch-mlir torchvision \ + --extra-index-url https://download.pytorch.org/whl/nightly/cpu \ + -f https://github.com/llvm/torch-mlir-release/releases/expanded_assets/dev-wheels + +RUN mlir_venv/bin/pip install fastapi uvicorn pytest httpx + +EXPOSE 3000 8000 + +CMD ["npm", "run", "start:all"] diff --git a/README.md b/README.md index 8548d63..0f79364 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,19 @@ npm run start:all Then open http://localhost:3000/ in your browser and enjoy! +### Run in a docker + +Build image with: + +```bash +docker build -t pytorch_explorer . +``` + +Run it: +```bash +docker run -p 3000:3000 -p 8000:8000 pytorch_explorer +``` + ### Run the tests With the application (or just backend) started, run: