This guide provides detailed instructions for setting up and running Bucky-Management in a development environment.
- Docker Desktop
- Docker Compose v2
- macOS (Intel or Apple Silicon)
- Ruby: 3.0.0 → 3.0.7 (Debian Bullseye, EOL対応)
- Bundler: 2.2.33 (Gemfile.lock互換性)
- MySQL: 5.7.39 (Intel) / 8.0 (Apple Silicon)
- Intel Mac: Uses
docker-compose.with_mysql.yml(MySQL 5.7.39) - Apple Silicon Mac: Uses
docker-compose.with_mysql.arm.yml(MySQL 8.0)
Create .env.development (if not exists):
TZ=Asia/Tokyo
RAILS_ENV=development
BUCKY_DB_NAME=bucky_development
BUCKY_DB_USERNAME=root
BUCKY_DB_PASSWORD=password
BUCKY_DB_HOSTNAME=db
SECRET_KEY_BASE=development_secret_key_base_dummy_value_for_local_development_onlyLoad environment variables:
export $(cat .env.development | xargs)Apple Silicon Mac:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml up -dIntel Mac:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.yml up -ddocker exec -it bm-app rails db:create
docker exec -it bm-app rails db:migrate- Development: http://localhost:3000
- Production: http://localhost (via nginx)
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml downdocker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml down -v# All containers
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml logs
# Specific container
docker logs bm-app
docker logs bm-mysql
docker logs bm-webdocker ps -a | grep bm-- Remove existing containers and volumes:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml down -v- Rebuild images:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml up -d --buildIf you encounter permission errors with MySQL volumes:
rm -rf docker/mysql/volumes
mkdir -p docker/mysql/volumesThe dev-entrypoint.sh script automatically runs bundle install on container startup. If gems are missing:
docker exec -it bm-app bundle install
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.with_mysql.arm.yml restart app-
Automatic Gem Installation (
dev-entrypoint.sh)- Runs
bundle installon startup - Waits for MySQL to be ready
- Prevents race conditions
- Runs
-
Volume Mounts
.:/app- Live code reloadingbundle_cache:/usr/local/bundle- Gem caching for faster startup
-
Port Mapping
- Port 3000 exposed for direct access
- Development uses TCP instead of Unix socket
docker-compose.yml # Base configuration
docker-compose.dev.yml # Development overrides
docker-compose.with_mysql.yml # MySQL 5.7 (Intel)
docker-compose.with_mysql.arm.yml # MySQL 8.0 (ARM)
dev-entrypoint.sh # Development startup script
.env.development # Development environment variables
| Component | Intel Mac | Apple Silicon Mac |
|---|---|---|
| MySQL Version | 5.7.39 | 8.0 |
| Platform | linux/amd64 | linux/arm64 |
| Compose File | with_mysql.yml | with_mysql.arm.yml |
| Collation | utf8mb4_general_ci | utf8mb4_0900_ai_ci |
- Default collation:
utf8mb4_0900_ai_ci - Authentication:
mysql_native_password - Named volumes for better permission handling
Production requires proper configuration:
export BUCKY_DB_NAME=bucky_production
export BUCKY_DB_USERNAME=your_username
export BUCKY_DB_PASSWORD=your_password
export BUCKY_DB_HOSTNAME=your_db_host
export SECRET_KEY_BASE=$(docker exec -it bm-app rake secret)- Uses Unix socket instead of TCP port
- No volume mounts (code baked into image)
- Nginx proxy on port 80
- No automatic gem installation
- Ruby 3.0.7 image:
cimg/ruby:3.0.7-node - Bundler config:
bundle config set --local path 'vendor/bundle' - Cache key:
Gemfile.lockchecksum
- Plugin format:
plugins: - rubocop-rails - Auto-enable new cops:
NewCops: enable - Department prefixes required (e.g.,
Style/Documentation)
- Bucky-core - Test execution framework
- Docker Compose Documentation
- Rails 7.0 Documentation