title | description | tags | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Directus (Docker + extensions + websocket) + PostGIS (Docker & TCP) + S3 |
A one-click-install Directus instance with PostGIS and S3 for persistent storage. |
|
- This has been updated to Directus 11.3
- Create snapshots with a single command: cd scripts && pnpm create-snapshot
- Extension folder updates: We've updated the extension folders to match the recommended structure. This ensures that you can load your downloaded and custom extensions correctly. Remember to commit the dist folder and package.json for custom extensions. We've included a custom extension as an example.
- Automatic schema synchronization: Run cd scripts && pnpm create-snapshot to create a snapshot of your working schema from your local development environment. Then, push your changes into your branch for deployment, and it will be synced to your Railway environment.
- Environment variable management: We've added a .env.example file(duplicate and rename to .env) to manage your environment variables and secrets. Docker Compose will use this file to load the environment variables.
This example runs a Directus instance with minimal config using PostGIS.
- Directus config is pre-configured
- Install Directus using Docker
- Directus extensions and websocket are pre-configured
- Directus version can be updated through Dockerfile
- Directus extensions can be updated and loaded through Dockerfile
- PostGIS config is pre-configured
- SSL certificates is pre-configured using the self-signed Snakeoil certificate for PostGIS
- Railway Database View is pre-configured
- Install PostGIS instead of Postgre as Directus recommended for supporting GIS features
- S3 for persistent storage
- docker-compose.yml is added for local development
- The communication from Directus to the database is accomplished through the private network, saving its users from egress fees. This reduces the users' exposure to unnecessary egress fees.
- Click the Deploy on Railway button
- Let railway deploy your service, most of the configurations have been preset, but feel free to tweak them as you like before deployment.
- Login in the admin panel using the defined ADMIN_EMAIL and ADMIN_PASSWORD.
- Use of S3 is a must in this template.
- For local development, just run
docker compose up
or run the same command twice (Sometimes, the Directus container starts before other containers are ready, resulting in a failure upon startup).
Directus extensions
Directus S3 image upload
Directus S3 storage
Railway Database View for Postgis
- This is a minimal one-click-deploy solution to Directus, see Directus docs to config it to your needs.
- Inspired and learnt from https://github.com/freekrai/directus-railway and https://railway.app/template/postgis