Your application is trying to write on a read-only filesystem.
The filesystem is writable only during the build hook. Everything happening after that point will be limited to read-only.
If you need to be able to perform post build hook write operations, you will have to use mounts.
You can find more information about this in the storage section of our documentation.
To tell the truth, I’m a beginner, so I only have the default configuration proposed.
my .platform.app.yaml
name: app
# The runtime the application uses. The 'type' key defines the base container
# image that will be used to run the application. There is a separate base
# container image for each primary language for the application,
# in multiple versions. Check the Ruby documentation
# (https://docs.platform.sh/languages/ruby.html#supported-versions)
# to find the supported versions for the 'ruby' type.
type: 'ruby:2.7'
# The relationships of the application with services or other applications.
#
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form <service name>:<endpoint name>.
relationships:
postgresdatabase: 'dbpostgres:postgresql'
# The size of the persistent disk of the application (in MB).
disk: 1024
hooks:
build: |
gem install bundler:2.2.8
bundle install --without development test
deploy: |
RACK_ENV=production
bundle exec rake db:migrate
# The following block defines a single writable directory, 'web/uploads'
# The 'source' specifies where the writable mount is. The 'local' source
# indicates that the mount point will point to a local directory on the
# application container. The 'source_path' specifies the subdirectory
# from within the source that the mount should point at.
mounts:
'web/uploads':
source: local
source_path: uploads
web:
upstream:
socket_family: "unix"
commands:
start: "\"unicorn -l $SOCKET -E production config.ru\""
locations:
'/':
root: "\"public\""
passthru: true
expires: "1h"
allow: true
This makes the /tmp directory writable.
To get a better understanding of how to configure your application, you can take a look at our ruby documentation page
Especially step 5, where mounts are setup.
thank you for your interest…
but after incorporating your recommendation,
I have always errors with APP, but I see Something interest on the connection to the database.
production:
database_url: postgresdatabase.internal
database_name: production
database_username: main
database_password: main
my .platform/services.yaml
# The name given to the PostgreSQL service (lowercase alphanumeric only).
dbpostgres:
# The type of your service (postgresql), which uses the format
# 'type:version'. Be sure to consult the PostgreSQL documentation
# (https://docs.platform.sh/configuration/services/postgresql.html#supported-versions)
# when choosing a version. If you specify a version number which is not available,
# the CLI will return an error.
type: postgresql:13
# The disk attribute is the size of the persistent disk (in MB) allocated to the service.
disk: 9216
configuration:
extensions:
- plpgsql
- pgcrypto
- uuid-ossp