By jessegader
Hi
I see now that docker volumes are not currently supported in the app platform I have added and attached a postgres database
In the Directus Docs there are folders to add as data volumes
database:
volumes:
- ./data/database:/var/lib/postgresql/data
directus:
volumes:
- ./uploads:/directus/uploads
- ./extensions:/directus/extensions
Is there a way to use the database to store persistent data ?
I have added additional environment variables following directus docker docs and matching my database connection info
DATABASE_URL=${database.DATABASE_URL}
SERVE_APP=true
DB_HOST=app-1234.db.ondigitalocean.com
DB_PORT=1234
DB_USER=1234
DB_PASSWORD=1234
Not sure that helps
Thanks for any assistance ! )
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Indeed, the DigitalOcean App Platform does not have direct support for Docker volumes in the same way a local Docker setup does and it is best to use a managed database.
There has been a similar discussion on the Directus GitHub repository here:
What you could do is to pass the database details via environment varialbes, eg:
envs:
- key: DB_SSL__REJECT_UNAUTHORIZED
scope: RUN_AND_BUILD_TIME
value: "true"
- key: DB_SSL__CA
scope: RUN_AND_BUILD_TIME
value: ${database-component.CA_CERT}
- key: DB_CONNECTION_STRING
scope: RUN_AND_BUILD_TIME
value: ${database-component.DATABASE_URL}
You can find the environment variables that Directus expects in their docs here:
https://docs.directus.io/self-hosted/config-options.html#database
Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.