Skip to content

Commit 85ea0be

Browse files
pjurewiczclaude
andcommitted
Add Dev Containers for one-click contributor setup
Provides PostgreSQL (pgvector/pg17), Ollama, and Ruby 3.4.7 out of the box. Works with VS Code Dev Containers, GitHub Codespaces, and JetBrains. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cfc97a6 commit 85ea0be

4 files changed

Lines changed: 79 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM ruby:3.4.7
2+
3+
RUN apt-get update -qq && \
4+
apt-get install --no-install-recommends -y \
5+
build-essential \
6+
git \
7+
libpq-dev \
8+
libyaml-dev \
9+
postgresql-client && \
10+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
11+
12+
WORKDIR /workspace

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "Planet",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspace",
6+
"forwardPorts": [3000],
7+
"postCreateCommand": "bundle install && bin/rails db:prepare && bin/rails db:seed",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"Shopify.ruby-lsp"
12+
]
13+
}
14+
}
15+
}

.devcontainer/docker-compose.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
services:
2+
app:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
command: sleep infinity
7+
volumes:
8+
- ..:/workspace:cached
9+
- bundle-cache:/usr/local/bundle
10+
ports:
11+
- "3000:3000"
12+
environment:
13+
DB_HOST: postgres
14+
DB_USER: postgres
15+
DB_PASSWORD: postgres
16+
OLLAMA_URL: http://ollama:11434
17+
depends_on:
18+
- postgres
19+
- ollama
20+
21+
postgres:
22+
image: pgvector/pgvector:pg17
23+
volumes:
24+
- postgres-data:/var/lib/postgresql/data
25+
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
26+
environment:
27+
POSTGRES_USER: postgres
28+
POSTGRES_PASSWORD: postgres
29+
30+
ollama:
31+
image: ollama/ollama:latest
32+
volumes:
33+
- ollama-models:/root/.ollama
34+
35+
volumes:
36+
postgres-data:
37+
bundle-cache:
38+
ollama-models:

.devcontainer/init.sql

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CREATE EXTENSION IF NOT EXISTS vector;
2+
3+
CREATE DATABASE planet_development_queue;
4+
CREATE DATABASE planet_test;
5+
CREATE DATABASE planet_test_queue;
6+
7+
\c planet_development_queue
8+
CREATE EXTENSION IF NOT EXISTS vector;
9+
10+
\c planet_test
11+
CREATE EXTENSION IF NOT EXISTS vector;
12+
13+
\c planet_test_queue
14+
CREATE EXTENSION IF NOT EXISTS vector;

0 commit comments

Comments
 (0)