-
-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: Add environment configuration and initialization script for Docker setup, including user permissions and Composer dependency management. #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2949617
fb4e29d
0903d04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# User and Group settings | ||
GROUP_ID=1000 | ||
GROUP_NAME=www-data | ||
USER_ID=1000 | ||
USER_NAME=www-data | ||
|
||
# Yii2 environment settings | ||
YII_DEBUG=true | ||
YII_ENV=dev |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Check if composer.json exists and vendor directory doesn't exist | ||
if [ -f "/app/composer.json" ] && [ ! -d "/app/vendor" ]; then | ||
echo "Installing Composer dependencies..." | ||
|
||
# Install dependencies based on environment | ||
if [ "$YII_ENV" = "prod" ]; then | ||
# Production: exclude dev dependencies and optimize autoloader | ||
composer install --no-dev --optimize-autoloader --no-interaction | ||
else | ||
# Development: include dev dependencies | ||
composer install --optimize-autoloader --no-interaction | ||
fi | ||
|
||
# Set proper ownership for vendor directory | ||
chown -R $USER_NAME:$GROUP_NAME /app/vendor | ||
|
||
echo "Composer dependencies installed successfully." | ||
fi | ||
|
||
# Start supervisord | ||
exec supervisord -c /etc/supervisor/supervisord.conf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
;apc.enable_cli = 1 | ||
# Global PHP configuration for the Docker container | ||
date.timezone = UTC | ||
display_errors = Off | ||
expose_php = Off | ||
memory_limit = 512M | ||
post_max_size = 150M | ||
session.auto_start = Off | ||
Comment on lines
+1
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Configuration clash:
🤖 Prompt for AI Agents
|
||
short_open_tag = Off | ||
expose_php = Off | ||
upload_max_filesize = 15M | ||
post_max_size = 150M | ||
memory_limit = 512M | ||
display_errors = Off | ||
|
||
# https://symfony.com/doc/current/performance.html | ||
# OPcache optimizations | ||
opcache.enable = 1 | ||
opcache.enable_cli = 1 | ||
opcache.interned_strings_buffer = 16 | ||
opcache.jit = tracing | ||
opcache.jit_buffer_size = 64M | ||
opcache.max_accelerated_files = 20000 | ||
opcache.memory_consumption = 256 | ||
opcache.validate_timestamps = 0 | ||
opcache.revalidate_freq = 2 | ||
opcache.validate_timestamps = 1 | ||
realpath_cache_size = 4096K | ||
realpath_cache_ttl = 600 | ||
opcache.preload_user = www-data | ||
realpath_cache_ttl = 120 |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ parameters: | |||||
- tests/Functional | ||||||
- tests/Unit | ||||||
|
||||||
tmpDir: %currentWorkingDirectory%/runtime | ||||||
tmpDir: %currentWorkingDirectory%/public/runtime | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid storing PHPStan cache inside the web-root
- tmpDir: %currentWorkingDirectory%/public/runtime
+ tmpDir: %currentWorkingDirectory%/runtime/phpstan Please relocate or ensure the directory is not served. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
|
||||||
yii2: | ||||||
config_path: %currentWorkingDirectory%/config/web/app.php | ||||||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Missing shebang breaks shell-lint and may execute under
/bin/sh
unexpectedlyAdd an explicit shebang and fail-fast flags:
This satisfies SC2148 and aborts on errors.
🧰 Tools
🪛 Shellcheck (0.10.0)
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
🤖 Prompt for AI Agents