Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.9

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
make \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements file
COPY requirements.txt .

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application
COPY . .

# Set up the .env file
COPY .env.example .env

# Set the default command to run the application
CMD ["make", "run"]
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,46 @@ We send to the LLM a text description of the screen. The LLM decide on the next
- Create a `.env` file and fill it with the content like in the `.env.example` file
- Run with `make run`

## Running with Docker

You can also run the application using Docker.

### Building the Docker Image

To build the Docker image, use the following command:

```bash
docker build -t diambra-app .
```
### Running the Docker Container
To run the Docker container, use the following command:

```bash
docker run --name diambra-container -v ~/.diambra/roms:/app/roms diambra-app
```

* If you encounter a conflict with an existing container name, you can remove the existing container with:

```bash
docker rm diambra-container
```

### Running with Docker Compose on Ollama locally

To start the services, use the following command:

```bash
docker-compose up
```

### Stopping the Services

To stop the services, use:

```bash
docker-compose down
```

## Test mode

To disable the LLM calls, set `DISABLE_LLM` to `True` in the `.env` file.
Expand Down
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '3.8'

services:
diambra:
build:
context: .
dockerfile: Dockerfile
volumes:
- ~/.diambra/roms:/app/roms
- .:/app
environment:
- OLLAMA_API_BASE=http://ollama:11434
depends_on:
- ollama
command: ["make", "local"]

ollama:
image: ollama/ollama
volumes:
- ollama:/root/.ollama
ports:
- "11434:11434"
command: >
sh -c "
ollama serve &
sleep 10 &&
ollama run mistral
"

volumes:
ollama: