Docker Deployment
Don't want to self-host?
Pricore Cloud provides a fully managed registry with zero setup, so you can focus on building, not infrastructure.
Deploy Pricore with Docker Compose for a simple, production-ready setup.
Quick Start
No cloning required — just download the compose file and start:
# Download the compose file
curl -o docker-compose.yml https://raw.githubusercontent.com/pricorephp/pricore/main/docker-compose.yml
# Start Pricore
docker compose up -d
# Set up your first user and organization
docker compose exec app php artisan pricore:installPricore will be available at http://localhost:8000.
Automatic Setup
On first boot, the entrypoint script automatically handles:
- APP_KEY generation — If no
APP_KEYis provided, one is generated and persisted to/app/storage/app_key(survives restarts via the storage volume) - SQLite database creation — Creates the database file if it doesn't exist
- Database migrations — Runs
php artisan migrate --force(only on the main app container, not horizon/scheduler) - Cache warming — Caches config, routes, views, and events for production performance
Horizon and the scheduler wait for the app container to be healthy before starting, ensuring migrations are complete.
Providing Your Own APP_KEY
For production, you should provide your own APP_KEY via environment variable:
# Generate a key
php -r "echo 'base64:'.base64_encode(random_bytes(32)).PHP_EOL;"
# Set it in your environment
APP_KEY=base64:your-generated-key docker compose up -dOr create a .env file next to your docker-compose.yml:
APP_KEY=base64:your-generated-key
APP_URL=https://pricore.yourcompany.comDocker Compose Services
| Service | Description | Port |
|---|---|---|
app | FrankenPHP web server | 8000 |
horizon | Queue worker with Horizon | - |
scheduler | Scheduled task runner | - |
redis | Cache, sessions, and queues | - |
Configuration
Changing the Port
APP_PORT=9000 docker compose up -dUsing External Database
For MySQL or PostgreSQL:
DB_CONNECTION=mysql
DB_HOST=your-db-host
DB_PORT=3306
DB_DATABASE=pricore
DB_USERNAME=pricore
DB_PASSWORD=your-passwordUsing External Redis
REDIS_HOST=your-redis-host
REDIS_PORT=6379
REDIS_PASSWORD=your-redis-passwordDevelopment Setup
Contributors who clone the repo can use the development compose file which builds from source and uses bind mounts:
git clone https://github.com/pricorephp/pricore.git
cd pricore
docker compose -f docker-compose.dev.yml up -d --buildReverse Proxy Setup
Nginx
server {
listen 80;
server_name pricore.yourcompany.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name pricore.yourcompany.com;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Caddy
pricore.yourcompany.com {
reverse_proxy localhost:8000
}Traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.pricore.rule=Host(`pricore.yourcompany.com`)"
- "traefik.http.routers.pricore.tls=true"
- "traefik.http.routers.pricore.tls.certresolver=letsencrypt"Updating
# Pull the latest image
docker compose pull
# Restart services (migrations run automatically)
docker compose up -dMaintenance
Viewing Logs
# All services
docker compose logs -f
# Specific service
docker compose logs -f app
docker compose logs -f horizonDatabase Operations
# Access tinker
docker compose exec app php artisan tinker
# Database backup (SQLite)
docker compose exec app cp /app/database/database.sqlite /app/database/backup.sqliteCache Operations
# Clear cache
docker compose exec app php artisan cache:clear
# Clear config cache
docker compose exec app php artisan config:clearTroubleshooting
Container Won't Start
- Check logs:
docker compose logs app - Verify environment variables are set
- Ensure ports aren't in use
- Check file permissions on volumes
Database Connection Issues
- Verify database container is healthy
- Check DB_HOST points to the service name (e.g.,
mysqlnotlocalhost) - Confirm credentials are correct
Redis Connection Issues
- Verify Redis container is healthy:
docker compose exec redis redis-cli ping - Check REDIS_HOST is set to
redis(service name) - Review Redis logs:
docker compose logs redis
Queue Jobs Not Processing
- Check Horizon status:
docker compose exec app php artisan horizon:status - View Horizon logs:
docker compose logs horizon - Restart Horizon:
docker compose restart horizon