Skip to content

Commit 553a566

Browse files
committed
Update render.yaml
1 parent 8e3d08f commit 553a566

File tree

1 file changed

+61
-34
lines changed

1 file changed

+61
-34
lines changed

render.yaml

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,54 @@ databases:
1313
# For MySQL, version is typically tied to the plan or a default.
1414

1515
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
16+
# PHP-FPM Service (Private Service)
17+
- type: pserv
18+
name: php-fpm # Internal service name
19+
runtime: docker # Added runtime
20+
dockerContext: . # Build from project root
21+
dockerfilePath: ./php-fpm.render.dockerfile # Using the Dockerfile we created
2322
envVars:
2423
- key: APP_NAME
2524
value: "Laravel Vue Ecommerce"
2625
- key: APP_ENV
2726
value: "production"
2827
- key: APP_DEBUG
29-
value: "false" # Env vars are strings
28+
value: "false"
3029
- key: APP_URL
31-
value: "${RENDER_EXTERNAL_URL}" # Render injects this
30+
value: "${RENDER_EXTERNAL_URL}" # Will be taken from the web service
3231
- key: ASSET_URL
33-
value: "${RENDER_EXTERNAL_URL}" # Render injects this
32+
value: "${RENDER_EXTERNAL_URL}" # Will be taken from the web service
3433
- key: APP_KEY
35-
generateValue: true # Valid per envVarFromKeyValue schema
34+
fromService:
35+
type: web
36+
name: laravel-vue-ecommerce # Name of the Nginx web service
37+
envVarKey: APP_KEY_GENERATED # Use a different key to avoid circular dependency if APP_KEY is also on web
3638
- key: LOG_CHANNEL
3739
value: "stderr"
38-
# Database Connection
39-
- key: DB_CONNECTION # Tells Laravel to use the mysql driver
40+
- key: DB_CONNECTION
4041
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
42+
- key: DATABASE_URL
43+
fromDatabase:
44+
name: ecommerce-db
45+
property: connectionString
4646
- key: CACHE_DRIVER
47-
value: "file"
47+
value: "file" # Consider 'redis' if you add a Redis service
4848
- key: SESSION_DRIVER
49-
value: "file"
50-
# Stripe Keys (Set these as secrets in Render dashboard)
49+
value: "file" # Consider 'redis'
5150
- key: STRIPE_KEY
52-
sync: false # Valid per envVarFromKeyValue schema
51+
sync: false
5352
- key: STRIPE_SECRET
5453
sync: false
5554
- key: STRIPE_WEBHOOK_SECRET
5655
sync: false
57-
# Cashier Settings
5856
- key: CASHIER_CURRENCY
5957
value: "NOK"
6058
- key: CASHIER_CURRENCY_LOCALE
6159
value: "nb-NO"
62-
# Mailer Configuration (example, adjust as needed)
6360
- key: MAIL_MAILER
6461
value: "smtp"
6562
- key: MAIL_HOST
66-
value: "your_mail_host" # Set as secret or actual value
63+
value: "your_mail_host"
6764
- key: MAIL_PORT
6865
value: "587"
6966
- key: MAIL_USERNAME
@@ -76,14 +73,44 @@ services:
7673
value: "hello@example.com"
7774
- key: MAIL_FROM_NAME
7875
value: "${APP_NAME}"
76+
# For Laradock PHP_VERSION in php-fpm.render.dockerfile build arg
77+
- key: PHP_VERSION
78+
value: "8.2" # Or from laradock/.env if possible, but direct is safer for Render
79+
disk:
80+
name: laravel-storage
81+
mountPath: /var/www/html/storage # Mount point for Laravel's storage
82+
sizeGB: 1 # sizeGB defined directly here
7983

80-
# Start command: The Docker image's CMD ["/start.sh"] will be used by default.
81-
# The /start.sh script from richarvey/nginx-php-fpm will execute our /scripts/00-laravel-deploy.sh
82-
# (because ENV RUN_SCRIPTS 1 is set) and then start Nginx & PHP-FPM.
83-
# Thus, no explicit startCommand override is needed here.
84+
# Nginx Service (Web Service)
85+
- type: web
86+
name: laravel-vue-ecommerce # Public-facing service name
87+
runtime: docker # Added runtime
88+
dockerContext: ./laradock/nginx # Build using Laradock's Nginx Dockerfile
89+
# dockerfilePath is implicitly Dockerfile within the context
90+
autoDeploy: false
91+
healthCheckPath: / # Or a static file like /favicon.ico, or /api/health if Nginx proxies it
92+
envVars:
93+
- key: APP_NAME # For consistency, though Nginx might not use it directly
94+
value: "Laravel Vue Ecommerce"
95+
- key: APP_ENV
96+
value: "production"
97+
- key: APP_URL
98+
value: "${RENDER_EXTERNAL_URL}"
99+
- key: ASSET_URL
100+
value: "${RENDER_EXTERNAL_URL}"
101+
- key: APP_KEY_GENERATED # Nginx service generates the APP_KEY
102+
generateValue: true
103+
# Environment variables for Laradock's Nginx entrypoint/configuration
104+
- key: NGINX_PHP_UPSTREAM_CONTAINER
105+
value: "php-fpm" # Must match the name of the php-fpm service above
106+
- key: NGINX_PHP_UPSTREAM_PORT
107+
value: "9000"
108+
- key: NGINX_APP_CODE_PATH_CONTAINER
109+
value: "/var/www/html" # Used by laradock/nginx/sites/default.conf
110+
# For Laradock PHP_VERSION in its Nginx Dockerfile build args (if it uses it)
111+
- key: PHP_VERSION
112+
value: "8.2"
113+
# Nginx service does not directly write to Laravel's storage,
114+
# but it needs the application code (public assets) which is built into its image.
84115

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
116+
# Top-level disks: block removed as it's not allowed by schema; disk defined in php-fpm service.

0 commit comments

Comments
 (0)