diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..c64e2cb418 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.vscode/ +.githooks/ +.github/ +.idea/ +.zed/ +target/ \ No newline at end of file diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-docker-image.yml new file mode 100644 index 0000000000..69981ffd81 --- /dev/null +++ b/.github/workflows/publish-docker-image.yml @@ -0,0 +1,38 @@ +name: Publish Docker Image + +on: + push: + branches: + - main + +jobs: + build-docker-image: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t exo/exo:latest . + +# +# Placeholder: until docker hub account is setup and secrets are added to the repository. +# +# publish-docker-image: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Login to Docker Hub +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# - name: Build and push Docker image +# uses: docker/build-push-action@v5 +# with: +# context: . +# push: true +# tags: | +# exo/exo:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..1085964356 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:latest +EXPOSE 52415 +ENV CARGO_HOME=/usr/local/cargo +ENV RUSTUP_HOME=/usr/local/rustup +ENV PATH=/usr/local/cargo/bin:$PATH +WORKDIR /home/exo +COPY --from=rust:latest /usr/local/cargo /usr/local/cargo +COPY --from=rust:latest /usr/local/rustup /usr/local/rustup +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ +COPY . . +RUN rustup toolchain install nightly && uv sync +WORKDIR /home/exo/dashboard +RUN npm install && npm run build +WORKDIR /home/exo +CMD [ "uv", "run", "exo" ] \ No newline at end of file diff --git a/README.md b/README.md index a05b74c4a7..a321fa3530 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,12 @@ exo follows the [XDG Base Directory Specification](https://specifications.freede You can override these locations by setting the corresponding XDG environment variables. +### Run in Docker + +```bash +docker run --gpus=all -v /.config/exo:/.config/exo/ -v /.local/share/exo/:/.local/share/exo/ -v /.cache/exo/:/.cache/exo/ -p 52415:52145 exo/exo:latest # or --privileged instead of --gpus=all to pass through all devices +``` + ### macOS App exo ships a macOS app that runs in the background on your Mac.