Files
claude/docker/archlinux/docker-compose.yml
2025-07-05 13:48:50 +09:00

104 lines
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
services:
claude-arch:
build:
context: .
dockerfile: Dockerfile
image: claude-archlinux:latest
container_name: claude-arch-sandbox
hostname: claude-arch
# ボリュームマウント
volumes:
# プロジェクトディレクトリをマウント
- ../../:/workspace:rw
# ホームディレクトリの設定ファイルを共有(オプション)
- ~/.config/nvim:/home/claude/.config/nvim:ro
- ~/.zshrc:/home/claude/.zshrc:ro
# DockerソケットDocker in Dockerを使う場合
# - /var/run/docker.sock:/var/run/docker.sock
# pacmanキャッシュを永続化ダウンロード時間短縮
- pacman-cache:/var/cache/pacman/pkg
# yayキャッシュを永続化
- yay-cache:/home/claude/.cache/yay
# 環境変数
environment:
- LANG=ja_JP.UTF-8
- TZ=Asia/Tokyo
- TERM=xterm-256color
# Claude Code用の環境変数
- CLAUDE_SAFE_MODE=true
- CLAUDE_CONTAINER=true
# リソース制限
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
# セキュリティオプション
security_opt:
- no-new-privileges:true
# AppArmorプロファイル利用可能な場合
# - apparmor:docker-default
# ネットワーク設定
networks:
- claude-net
# 対話型シェルの有効化
stdin_open: true
tty: true
# 読み取り専用ルートファイルシステム(より安全だが制限的)
# read_only: true
# tmpfs:
# - /tmp
# - /run
# - /home/claude/.cache
# ユーザー指定
user: claude
# ヘルスチェック
healthcheck:
test: ["CMD", "echo", "healthy"]
interval: 30s
timeout: 3s
retries: 3
# 開発用データベース(必要に応じて)
# postgres:
# image: postgres:15-alpine
# container_name: claude-postgres
# environment:
# POSTGRES_DB: dev
# POSTGRES_USER: claude
# POSTGRES_PASSWORD: claude-dev-pass
# volumes:
# - postgres-data:/var/lib/postgresql/data
# networks:
# - claude-net
# ボリューム定義
volumes:
pacman-cache:
driver: local
yay-cache:
driver: local
# postgres-data:
# driver: local
# ネットワーク定義
networks:
claude-net:
driver: bridge
ipam:
config:
- subnet: 172.25.0.0/24