Skip to content

Instantly share code, notes, and snippets.

@meerzulee
Created March 24, 2024 12:30
Show Gist options
  • Save meerzulee/c184c5a87bd1dfe656e2d2e0083ee4d2 to your computer and use it in GitHub Desktop.
Save meerzulee/c184c5a87bd1dfe656e2d2e0083ee4d2 to your computer and use it in GitHub Desktop.
Directus Docker compose file with fixed folder permissions: data, uploads, extensions
version: '3'
services:
database:
image: postgis/postgis:13-master
# Required when running on platform other than amd64, like Apple M1/M2:
# platform: linux/amd64
ports:
- 5432:5432
volumes:
- ./data/database:/var/lib/postgresql/data
environment:
POSTGRES_USER: 'directus'
POSTGRES_PASSWORD: 'directus'
POSTGRES_DB: 'directus'
cache:
image: redis:6
directus:
image: directus/directus:10.8.3
ports:
- 8055:8055
volumes:
- the_uploads:/directus/uploads
- the_extensions:/directus/extensions
depends_on:
- cache
- database
environment:
KEY: '255d861b-5ea1-5996-9aa3-922530ec40b1'
SECRET: '6116487b-cda1-52c2-b5b5-c8022c45e263'
DB_CLIENT: 'pg'
DB_HOST: 'database'
DB_PORT: '5432'
DB_DATABASE: 'directus'
DB_USER: 'directus'
DB_PASSWORD: 'directus'
CACHE_ENABLED: 'false'
CACHE_STORE: 'redis'
REDIS: 'redis://cache:6379'
ADMIN_EMAIL: 'admin@example.com'
ADMIN_PASSWORD: 'admin@example.com'
# These is helpful for local developement but should probably be removed in production
CORS_ENABLED: 'true'
REFRESH_TOKEN_COOKIE_DOMAIN: 'localhost'
EXTENSIONS_AUTO_RELOAD: 'true'
WEBSOCKETS_ENABLED: 'true'
# The default config prevents importing files from 0.0.0.0. See https://docs.directus.io/self-hosted/config-options.html#security . This can be removed in production but in local development it is recommended to keep it so you can import logos from Organization > website.
IMPORT_IP_DENY_LIST: ''
# Make sure to set this in production
# (see https://docs.directus.io/self-hosted/config-options#general)
# PUBLIC_URL: 'https://directus.example.com'
volumes:
the_uploads:
driver: local
driver_opts:
type: none
o: bind
device: ./data/uploads
the_extensions:
driver: local
driver_opts:
type: none
o: bind
device: ./data/extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment