Skip to content
Open
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.env
.git
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
FROM oven/bun:latest

RUN apt-get update -qq && apt-get install -y -qq cron wget && rm -rf /var/lib/apt/lists/*

ENV TZ=UTC
FROM oven/bun:1

WORKDIR /app

# Install deps
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile 2>/dev/null || bun install

# Copy source
COPY src/ ./src/
COPY tsconfig.json ./
# Install build tools (REQUIRED for better-sqlite3)
RUN apt-get update && apt-get install -y \
python3 \
make \
g++ \
sqlite3 \
libsqlite3-dev

# Data volume for SQLite
RUN mkdir -p /app/data
# Copy only package files first
COPY package.json bun.lockb* ./

ENV BRAINDB_PORT=3197
ENV BRAINDB_PATH=/app/data/memories.db
# Install dependencies (force proper build)
RUN bun install

EXPOSE 3197
# Copy rest of code
COPY . .

HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD wget -qO- http://localhost:3197/health || exit 1
EXPOSE 3000

CMD ["bun", "run", "src/server.ts"]
CMD ["bun", "run", "dev"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ An open-source project.
## Quick Start

### Docker (recommended)
## Run with Docker

### Prerequisites
- Docker
- Docker Compose

### Steps

1. Create a `.env` file:
```bash
touch .env

```bash
# Clone the repo
Expand Down