If you want to use the prebuilt image (without building), follow these steps:
docker pull vannhatcd/php8.3-fpm-nginx:latest
Example:
docker pull vannhatcd/php8.3-fpm-nginx:latest
docker-compose.yml, use the image field instead of build:services:
app:
image: vannhatcd/php8.3-fpm-nginx:latest
ports:
- "8080:80"
volumes:
- .:/var/www/html
- ./logs/nginx:/var/log/nginx
- ./logs/php-fpm:/var/log/php-fpm
- ./logs/supervisor:/var/log/supervisor
- ./cronjobs/app-cron:/etc/cron.d/app-cron
environment:
- APP_PORT=8080
- APP_ENV=production
- DB_HOST=mysql
- REDIS_HOST=redis
- PHP_MEMORY_LIMIT=512M
- PHP_OPCACHE_ENABLE=1
# ... other variables
depends_on:
- mysql
- redis
mysql:
image: mysql:8.0
environment:
MYSQL_DATABASE: ecommerce
MYSQL_ROOT_PASSWORD: secret
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
redis:
image: redis:7-alpine
volumes:
mysql-data:
docker compose up -d
phpaddmod script as described above.docker-compose.yml with the prefix PHP_.environment:
- PHP_MEMORY_LIMIT=512M
- PHP_UPLOAD_MAX_FILESIZE=100M
- PHP_POST_MAX_SIZE=100M
- PHP_OPCACHE_ENABLE=1
- PHP_OPCACHE_MEMORY_CONSUMPTION=512
# ... add more as needed
php.ini inside the container.PHP_FPM_:
environment:
- PHP_FPM_MAX_CHILDREN=50
- PHP_FPM_START_SERVERS=10
- PHP_FPM_MIN_SPARE_SERVERS=5
- PHP_FPM_MAX_SPARE_SERVERS=20
www.conf inside the container.phpaddmod script to install PHP extensions at runtime.phpaddmod <extension_name>
# Example:
phpaddmod redis
phpaddmod gd
phpaddmod <extension_name>
./logs/nginx → Nginx logs./logs/php-fpm → PHP-FPM logs./logs/supervisor → Supervisor logs./storage/logs → Laravel logs./cronjobs/app-cron → cronjob file (create on host, mount into container)cronjobs/app-cron file on host, e.g.:
* * * * * cd /var/www/html && php artisan schedule:run >> /var/log/cron.log 2>&1
/etc/cron.d/app-cron in the container.APP_PORT variable in environment.sessions table is missing, set SESSION_DRIVER=file in .env.If you encounter issues, check logs in the mapped folders or contact admin/dev for support.
Content type
Image
Digest
sha256:8ad10270a…
Size
103.5 MB
Last updated
5 months ago
docker pull vannhatcd/php8.3-fpm-nginx