21 lines
648 B
Bash
21 lines
648 B
Bash
#!/bin/bash
|
|
|
|
# Get the container name from first argument, default to 'web' if not provided
|
|
container_name=${1:-web}
|
|
|
|
# Check if we're in a directory with either compose.yml or compose.yaml
|
|
if [[ ! -f "compose.yml" ]] && [[ ! -f "compose.yaml" ]]; then
|
|
echo "No compose.yml or compose.yaml found in current directory"
|
|
exit 1
|
|
fi
|
|
|
|
# Connect to the rails console with specified container
|
|
docker compose exec -it "$container_name" bundle exec rails console
|
|
|
|
# @PICOPACKAGE_START
|
|
# ---
|
|
# filename: docker-rails-console
|
|
# version: 1.0
|
|
# content_checksum: sha256:c3a98dedbafbc310008382042630a5a4152fb12f02b497c57c7198fc6bca8fbc
|
|
# @PICOPACKAGE_END
|