AgenziaSmart frankenphp-imageproc 8.3-alpine
3.1K
FrankenPHP 8.3 ottimizzato per image processing (resize, thumbnails, watermark) con GD e worker mode.
| Aspetto | Separato | Integrato in API |
|---|---|---|
| Scaling | Indipendente (CPU-intensive) | Scala con API (I/O-bound) |
| Memory | Ottimizzato per GD | Condivide con business logic |
| Failure isolation | OOM non blocca API | Crash totale |
| CDN | CloudFront dedicato | Cache mista |
Pattern usato da: imgproxy, Thumbor, Imaginary.
| Estensione | Descrizione |
|---|---|
| gd | Image processing (PNG, JPEG, WebP, GIF) |
| opcache | Cache bytecode (JIT off di default) |
| zip | Compressione (Composer) |
Nota: Redis non incluso. ABS usa filesystem cache. Per rate limiting distribuito in futuro, considerare aggiunta.
| Tag | Descrizione | Uso |
|---|---|---|
8.3-alpine | PHP 8.3 su Alpine | Produzione |
8-alpine | Latest PHP 8.x su Alpine | Dev/Staging |
alpine | Latest stable | Quick tests |
docker pull agenziasmart/frankenphp-imageproc:8.3-alpine
# Test
docker run --rm -p 8080:8080 agenziasmart/frankenphp-imageproc:8.3-alpine
| Variabile | Default | Descrizione |
|---|---|---|
SERVER_NAME | :8080 | Hostname e porta |
FRANKENPHP_CONFIG | worker ./public/index.php | Configurazione worker |
MAX_REQUESTS | 500 | Richieste prima di restart worker |
# Memory per elaborazione immagini
memory_limit=192M # 128M + headroom per GD
# Execution time per resize grandi
max_execution_time=60
# OPcache ridotto (meno file da cachare)
opcache.memory_consumption=64
opcache.max_accelerated_files=2000
; JIT OFF di default — il tracing JIT ha miscompilato il container PHP-DI
; su PHP 8.5 ZTS in worker mode (incidente prod SW4 2026-07-13).
; OPcache resta ATTIVO: e' solo il JIT a essere spento.
opcache.jit=disable
opcache.jit_buffer_size=0
Contratto ini. I file in
/usr/local/etc/php/custom.d/sono letti dopo quelli della base (conf.d) e vincono sempre, con qualunque nome di file: la priorita' dipende dalla directory (PHP_INI_SCAN_DIR), non dall'ordine alfabetico dei nomi. Non scrivere inconf.d/: e' territorio della base.
In un Dockerfile:
COPY docker/php/php.ini-prd /usr/local/etc/php/custom.d/php.ini
Riabilitare il JIT (solo se l'applicazione e' davvero CPU-bound in userland PHP, e l'hai misurato — su carichi I/O-bound il guadagno e' rumore statistico):
; in custom.d/php.ini — usa i preset documentati da PHP. MAI 1255.
opcache.jit = 1254 ; tracing (preset ufficiale)
opcache.jit_buffer_size = 64M
Oppure montando un file a runtime:
docker run -v ./my-config.ini:/usr/local/etc/php/custom.d/my-config.ini:ro \
agenziasmart/frankenphp-imageproc:8.3-alpine
services:
abs:
image: agenziasmart/frankenphp-imageproc:8.3-alpine
ports:
- "8081:8080"
volumes:
- ./abs:/app
- image_cache:/tmp/abs
environment:
- SERVER_NAME=:8080
- MAX_REQUESTS=500
volumes:
image_cache:
{
"family": "abs-imageproc",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"],
"cpu": "512",
"memory": "1024",
"containerDefinitions": [
{
"name": "abs",
"image": "agenziasmart/frankenphp-imageproc:8.3-alpine",
"portMappings": [
{
"containerPort": 8080,
"protocol": "tcp"
}
],
"environment": [
{"name": "SERVER_NAME", "value": ":8080"},
{"name": "MAX_REQUESTS", "value": "500"}
],
"healthCheck": {
"command": ["CMD-SHELL", "curl -f http://localhost:8080/health || exit 1"],
"interval": 30,
"timeout": 5,
"retries": 3
},
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/abs-imageproc",
"awslogs-region": "eu-west-1",
"awslogs-stream-prefix": "ecs"
}
}
}
]
}
// composer require intervention/image
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Gd\Driver;
$manager = new ImageManager(new Driver());
$image = $manager->read('photo.jpg')
->resize(800, 600)
->toWebp(quality: 85);
// composer require league/glide
use League\Glide\ServerFactory;
$server = ServerFactory::create([
'source' => '/path/to/source',
'cache' => '/tmp/abs',
'driver' => 'gd', // usa GD, non Imagick
]);
$server->outputImage('photo.jpg', ['w' => 800, 'h' => 600, 'fm' => 'webp']);
Questa immagine non include un HEALTHCHECK integrato. Come le immagini ufficiali Docker (php, nginx, node), la configurazione degli health check è responsabilità del livello applicativo/orchestrazione.
services:
abs:
image: agenziasmart/frankenphp-imageproc:8.3-alpine
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8080/health || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
"healthCheck": {
"command": ["CMD-SHELL", "curl -f http://localhost:8080/health || exit 1"],
"interval": 30,
"timeout": 5,
"retries": 3,
"startPeriod": 10
}
Nota: Adatta la porta e il path (
/health) alla configurazione della tua applicazione. Se usiSERVER_NAME=:80, il health check deve puntare alocalhost:80.
docker run --rm agenziasmart/frankenphp-imageproc:8.3-alpine php -m | grep -E 'gd|OPcache'
Output atteso:
OPcache
gd
docker run --rm agenziasmart/frankenphp-imageproc:8.3-alpine php -r "print_r(gd_info());"
cd images/frankenphp/8.3/imageproc
docker build -t frankenphp-imageproc:local .
MIT
Content type
Image
Digest
sha256:db1d76cc9…
Size
92.6 MB
Last updated
4 days ago
docker pull agenziasmart/frankenphp-imageproc:8.3-alpine-20261012