@@ -13,57 +13,54 @@ databases:
13
13
# For MySQL, version is typically tied to the plan or a default.
14
14
15
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
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
23
22
envVars :
24
23
- key : APP_NAME
25
24
value : " Laravel Vue Ecommerce"
26
25
- key : APP_ENV
27
26
value : " production"
28
27
- key : APP_DEBUG
29
- value : " false" # Env vars are strings
28
+ value : " false"
30
29
- key : APP_URL
31
- value : " ${RENDER_EXTERNAL_URL}" # Render injects this
30
+ value : " ${RENDER_EXTERNAL_URL}" # Will be taken from the web service
32
31
- key : ASSET_URL
33
- value : " ${RENDER_EXTERNAL_URL}" # Render injects this
32
+ value : " ${RENDER_EXTERNAL_URL}" # Will be taken from the web service
34
33
- 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
36
38
- key : LOG_CHANNEL
37
39
value : " stderr"
38
- # Database Connection
39
- - key : DB_CONNECTION # Tells Laravel to use the mysql driver
40
+ - key : DB_CONNECTION
40
41
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
46
46
- key : CACHE_DRIVER
47
- value : " file"
47
+ value : " file" # Consider 'redis' if you add a Redis service
48
48
- key : SESSION_DRIVER
49
- value : " file"
50
- # Stripe Keys (Set these as secrets in Render dashboard)
49
+ value : " file" # Consider 'redis'
51
50
- key : STRIPE_KEY
52
- sync : false # Valid per envVarFromKeyValue schema
51
+ sync : false
53
52
- key : STRIPE_SECRET
54
53
sync : false
55
54
- key : STRIPE_WEBHOOK_SECRET
56
55
sync : false
57
- # Cashier Settings
58
56
- key : CASHIER_CURRENCY
59
57
value : " NOK"
60
58
- key : CASHIER_CURRENCY_LOCALE
61
59
value : " nb-NO"
62
- # Mailer Configuration (example, adjust as needed)
63
60
- key : MAIL_MAILER
64
61
value : " smtp"
65
62
- key : MAIL_HOST
66
- value : " your_mail_host" # Set as secret or actual value
63
+ value : " your_mail_host"
67
64
- key : MAIL_PORT
68
65
value : " 587"
69
66
- key : MAIL_USERNAME
@@ -76,14 +73,44 @@ services:
76
73
value : " hello@example.com"
77
74
- key : MAIL_FROM_NAME
78
75
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
79
83
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.
84
115
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