-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
183 lines (167 loc) · 7.15 KB
/
.env.example
File metadata and controls
183 lines (167 loc) · 7.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# Ruby Development Environment Configuration
#
# IMPORTANT: Copy this file to .env and customize for your system
# WORKSPACE_PATH should be set (defaults to current directory if not set)
#
# cp .env.example .env
# =============================================================================
# WORKSPACE CONFIGURATION (REQUIRED)
# =============================================================================
# Path to your development workspace directory
# This directory will be mounted as /workspace inside the container
# Linux/macOS examples:
WORKSPACE_PATH=/home/user/development
# WORKSPACE_PATH=/Users/username/development
# Windows examples:
# WORKSPACE_PATH=C:/Users/username/development
# WORKSPACE_PATH=C:/dev/projects
# WORKSPACE_PATH=D:/code
# Current directory (fallback if not set - NOT recommended for production use):
# WORKSPACE_PATH=.
# =============================================================================
# RUBY CONFIGURATION (OPTIONAL)
# =============================================================================
# Ruby version to use (default: 3.1)
# Available versions: 2.7, 3.0, 3.1, 3.2, 3.3
# You can also use specific tags like: 3.1-slim, 3.1-alpine
RUBY_VERSION=3.1
# Container name (default: ruby-dev-container)
CONTAINER_NAME=ruby-dev-container
# =============================================================================
# USER CONFIGURATION (OPTIONAL)
# =============================================================================
# User and group IDs for file ownership (default: 1000:1000)
# Should match your host user to avoid permission issues
PUID=1000
PGID=1000
# =============================================================================
# TIMEZONE CONFIGURATION (OPTIONAL)
# =============================================================================
# Timezone for the container (default: UTC)
# Examples: Europe/London, America/New_York, Asia/Tokyo
TZ=UTC
# =============================================================================
# RESOURCE LIMITS (OPTIONAL)
# =============================================================================
# Prevent runaway Ruby processes from consuming all system resources
# Defaults are set to 80% of typical development machine (8GB RAM, 4 CPUs)
# Memory limits (examples: 1G, 2048M, 512M)
MEMORY_LIMIT=6400M # Maximum memory (default: ~6.4GB)
MEMORY_RESERVATION=512M # Minimum guaranteed memory (default: 512MB)
# CPU limits (examples: 1.0, 2.5, 0.5)
CPU_LIMIT=3.2 # Maximum CPU cores (default: 3.2 cores)
CPU_RESERVATION=0.5 # Minimum guaranteed CPU (default: 0.5 cores)
# =============================================================================
# AUTOMATIC SYSTEM DETECTION (ADVANCED)
# =============================================================================
# To automatically set limits to 80% of your system resources, run these commands
# and use the output values above:
#
# Memory (80% of total):
# echo "MEMORY_LIMIT=$(($(grep MemTotal /proc/meminfo | awk '{print $2}') * 80 / 100 / 1024))M"
#
# CPU (80% of total):
# echo "CPU_LIMIT=$(echo "$(nproc) * 0.8" | bc)"
#
# Example output for 16GB/8-core system:
# MEMORY_LIMIT=12800M
# CPU_LIMIT=6.4
# =============================================================================
# GIT CONFIGURATION (OPTIONAL)
# =============================================================================
# Uncomment the git volume mounts in compose.yaml if you want to:
# - Use your host Git configuration inside the container
# - Access private repositories via SSH keys
# - Maintain consistent Git identity across host and container
#
# The following paths will be mounted if enabled:
# - ~/.gitconfig (Git configuration)
# - ~/.git-credentials (Git credentials)
# - ~/.ssh (SSH keys for Git operations)
#
# Note: Ensure your SSH keys have appropriate permissions (600/700)
# =============================================================================
# RUBY-SPECIFIC CONFIGURATION (ADVANCED)
# =============================================================================
# The following Ruby environment variables are pre-configured in compose.yaml:
#
# BUNDLE_PATH=/usr/local/bundle # Where gems are installed
# BUNDLE_BIN=/usr/local/bundle/bin # Where gem binaries are stored
# GEM_HOME=/usr/local/bundle # Primary gem installation directory
# BUNDLE_SILENCE_ROOT_WARNING=1 # Disable Bundler root warnings
#
# Additional Ruby configuration options you can add to compose.yaml if needed:
# BUNDLE_JOBS=4 # Parallel gem installation
# BUNDLE_RETRY=3 # Retry failed gem downloads
# BUNDLE_WITHOUT=development:test # Skip gem groups
# RUBY_YJIT_ENABLE=1 # Enable YJIT compiler (Ruby 3.1+)
# =============================================================================
# EXAMPLE DIRECTORY STRUCTURE
# =============================================================================
# Linux/macOS example:
# /home/user/
# ├── development/ # WORKSPACE_PATH
# │ ├── rails-app/
# │ │ ├── Gemfile
# │ │ ├── Gemfile.lock
# │ │ ├── app/
# │ │ └── config/
# │ ├── sinatra-app/
# │ │ ├── Gemfile
# │ │ └── app.rb
# │ └── ruby-scripts/
# │ ├── script1.rb
# │ └── script2.rb
# ├── .gitconfig # Optional Git config
# ├── .git-credentials # Optional Git credentials
# └── .ssh/ # Optional SSH keys
# ├── id_rsa
# ├── id_rsa.pub
# └── known_hosts
#
# Windows example:
# C:/Users/username/
# ├── development/ # WORKSPACE_PATH=C:/Users/username/development
# │ ├── rails-app/
# │ │ ├── Gemfile
# │ │ ├── Gemfile.lock
# │ │ ├── app/
# │ │ └── config/
# │ ├── sinatra-app/
# │ │ ├── Gemfile
# │ │ └── app.rb
# │ └── ruby-scripts/
# │ ├── script1.rb
# │ └── script2.rb
# ├── .gitconfig # %USERPROFILE%/.gitconfig
# ├── .git-credentials # %USERPROFILE%/.git-credentials
# └── .ssh/ # %USERPROFILE%/.ssh
# ├── id_rsa
# ├── id_rsa.pub
# └── known_hosts
#
# Ensure workspace directory permissions:
# Linux/macOS: sudo chown -R $USER:$USER /home/user/development
# Windows: Ensure your user has full control of the directory
# =============================================================================
# COMMON RUBY COMMANDS
# =============================================================================
# Once the container is running, you can use these commands:
#
# Install gems:
# docker compose exec ruby-dev bundle install
#
# Run Ruby scripts:
# docker compose exec ruby-dev ruby script.rb
#
# Start Rails server (if using Rails):
# docker compose exec ruby-dev bundle exec rails server -b 0.0.0.0
#
# Generate new Rails app:
# docker compose exec ruby-dev rails new myapp --database=postgresql
#
# Run IRB (Interactive Ruby):
# docker compose exec ruby-dev irb
#
# Install a specific gem:
# docker compose exec ruby-dev gem install gem_name