Skip to content

Commit 8ab13f3

Browse files
authored
Add Docker environment for development (#1206)
1 parent 10c14b3 commit 8ab13f3

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ dist
1414
.aider*
1515
!.aiderignore
1616

17+
docker-compose.override.yml
18+
Dockerfile.local
19+
1720
**/.claude/settings.local.json
1821
CLAUDE.local.md
1922
.zed

Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Development container for braintrust-sdk-ruby
2+
FROM debian:trixie-slim
3+
4+
# Set UTF-8 locale
5+
ENV LANG=C.UTF-8 \
6+
LC_ALL=C.UTF-8
7+
8+
# Configure UV to use copy mode (expected in Docker with different filesystems)
9+
ENV UV_LINK_MODE=copy
10+
11+
# Install curl, ca-certificates, and git first (needed for install-deps.sh and mise)
12+
RUN apt-get update && apt-get install -y --no-install-recommends \
13+
build-essential \
14+
curl \
15+
ca-certificates \
16+
git \
17+
openssh-client \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
# Create non-root user with configurable UID/GID
21+
ARG UID=1000
22+
ARG GID=1000
23+
RUN groupadd -g $GID dev && useradd -m -u $UID -g $GID dev
24+
25+
# Create directories for mise and bundle cache
26+
RUN mkdir -p /home/dev/.local/share/mise /home/dev/.local/bin \
27+
&& chown -R dev:dev /home/dev
28+
29+
# Switch to non-root user
30+
USER dev
31+
ENV HOME=/home/dev
32+
ENV PATH="/home/dev/.local/bin:$PATH"
33+
34+
# Install mise as the dev user
35+
RUN curl https://mise.run | sh
36+
37+
# Configure git safe.directory for mounted volumes
38+
RUN git config --global --add safe.directory /app
39+
40+
# Activate mise in bash
41+
RUN echo 'eval "$(mise activate bash)"' >> ~/.bashrc
42+
43+
WORKDIR /app
44+
45+
CMD ["bash"]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
dev:
3+
build: .
4+
volumes:
5+
- .:/app
6+
- dev-home:/home/dev/
7+
working_dir: /app
8+
env_file: .env
9+
environment:
10+
- MISE_TRUSTED_CONFIG_PATHS=/app
11+
12+
volumes:
13+
dev-home:

0 commit comments

Comments
 (0)