|
| 1 | +# render.yaml |
| 2 | +# Defines the infrastructure for deploying the Laravel application on Render |
| 3 | +# based on the provided schema.json. |
| 4 | +# Assumes CircleCI builds the Docker image, pushes it to a registry, |
| 5 | +# and then triggers a deploy on Render using a deploy hook. |
| 6 | + |
| 7 | +databases: |
| 8 | + - name: ecommerce-db # Name for your managed MySQL database |
| 9 | + plan: free # Example: "free", "starter", etc. |
| 10 | + # databaseName: laravel_ecommerce_db # Optional: specify the actual database name |
| 11 | + # user: db_user # Optional: specify the username |
| 12 | + # The schema provided lists postgresMajorVersion, not mysqlMajorVersion. |
| 13 | + # For MySQL, version is typically tied to the plan or a default. |
| 14 | + |
| 15 | +services: |
| 16 | + - type: web # Must be one of "web", "worker", "pserv", "cron" for serverService |
| 17 | + name: laravel-vue-ecommerce |
| 18 | + runtime: docker # Valid runtime for serverService |
| 19 | + autoDeploy: false # Boolean value |
| 20 | + healthCheckPath: /api/health # For web services |
| 21 | + # image: # Define if image is pre-built and pushed to a registry |
| 22 | + # url: registry.render.com/YOUR_RENDER_ORG_OR_USER/laravel-vue-ecommerce:latest |
| 23 | + envVars: |
| 24 | + - key: APP_NAME |
| 25 | + value: "Laravel Vue Ecommerce" |
| 26 | + - key: APP_ENV |
| 27 | + value: "production" |
| 28 | + - key: APP_DEBUG |
| 29 | + value: "false" # Env vars are strings |
| 30 | + - key: APP_URL |
| 31 | + value: "${RENDER_EXTERNAL_URL}" # Render injects this |
| 32 | + - key: ASSET_URL |
| 33 | + value: "${RENDER_EXTERNAL_URL}" # Render injects this |
| 34 | + - key: APP_KEY |
| 35 | + generateValue: true # Valid per envVarFromKeyValue schema |
| 36 | + - key: LOG_CHANNEL |
| 37 | + value: "stderr" |
| 38 | + # Database Connection |
| 39 | + - key: DB_CONNECTION # Tells Laravel to use the mysql driver |
| 40 | + value: "mysql" |
| 41 | + - key: DATABASE_URL # Laravel will parse this if DB_CONNECTION is set |
| 42 | + fromDatabase: # Valid per envVarFromDatabase schema |
| 43 | + name: ecommerce-db # Must match the name in the top-level 'databases' section |
| 44 | + property: connectionString # Provides the full database connection URL |
| 45 | + # Cache and Session |
| 46 | + - key: CACHE_DRIVER |
| 47 | + value: "file" |
| 48 | + - key: SESSION_DRIVER |
| 49 | + value: "file" |
| 50 | + # Stripe Keys (Set these as secrets in Render dashboard) |
| 51 | + - key: STRIPE_KEY |
| 52 | + sync: false # Valid per envVarFromKeyValue schema |
| 53 | + - key: STRIPE_SECRET |
| 54 | + sync: false |
| 55 | + - key: STRIPE_WEBHOOK_SECRET |
| 56 | + sync: false |
| 57 | + # Cashier Settings |
| 58 | + - key: CASHIER_CURRENCY |
| 59 | + value: "NOK" |
| 60 | + - key: CASHIER_CURRENCY_LOCALE |
| 61 | + value: "nb-NO" |
| 62 | + # Mailer Configuration (example, adjust as needed) |
| 63 | + - key: MAIL_MAILER |
| 64 | + value: "smtp" |
| 65 | + - key: MAIL_HOST |
| 66 | + value: "your_mail_host" # Set as secret or actual value |
| 67 | + - key: MAIL_PORT |
| 68 | + value: "587" |
| 69 | + - key: MAIL_USERNAME |
| 70 | + sync: false |
| 71 | + - key: MAIL_PASSWORD |
| 72 | + sync: false |
| 73 | + - key: MAIL_ENCRYPTION |
| 74 | + value: "tls" |
| 75 | + - key: MAIL_FROM_ADDRESS |
| 76 | + |
| 77 | + - key: MAIL_FROM_NAME |
| 78 | + value: "${APP_NAME}" |
| 79 | + |
| 80 | + # Start command: runs our deploy script, then starts the main services. |
| 81 | + # Assumes the base Docker image (ric_harvey/nginx-php-fpm) has /start.sh as its CMD, |
| 82 | + # which typically runs supervisord to manage Nginx and PHP-FPM. |
| 83 | + startCommand: "/usr/local/bin/deploy.sh && /start.sh" |
| 84 | + |
| 85 | + # Persistent disk for Laravel storage |
| 86 | + disk: # Valid per serverService schema, referencing "disk" definition |
| 87 | + name: laravel-storage # Name for the persistent disk |
| 88 | + mountPath: /var/www/html/storage # Mount path inside the container |
| 89 | + sizeGB: 1 # Size of the disk in GB, integer |
0 commit comments