Update docker.md

This commit is contained in:
João
2021-04-20 11:38:18 -03:00
committed by GitHub
parent be9e22598f
commit 3900e19ddb

View File

@@ -31,6 +31,16 @@ ADMIN_EMAIL="admin@example.com"
ADMIN_PASSWORD="d1r3ctu5"
```
## Persistence
Containers are ephemeral, and this means that whenever you stop a container, all the data associated with it is going to be removed [unless you persist them] when creating your container (https://docs.docker.com/storage/).
Directus image by default [will use the following locations](https://github.com/directus/directus/blob/main/.github/actions/build-images/rootfs/directus/images/main/Dockerfile#L93-L96) for data persistence (unless changed through environment variables)
- `/directus/uploads` for uploads
- `/directus/database` (only when using SQLite and not configured to a different folder)
- `/directus/extensions` for extension loadings
## Docker Compose
When using Docker compose, you can use the following setup to get you started:
@@ -61,6 +71,15 @@ services:
image: directus/directus:v9.0.0-rc.24
ports:
- 8055:8055
volumes:
# By default, Directus images writes uploads to /directus/uploads
# Always make sure your volumes matches the storage root when using
# local driver
- ./uploads:/directus/uploads
# Make sure to also mount the volume When using SQLite
# - ./database:/directus/database
# If you want to load extensions from the host
# - ./extensions:/directus/extensions
networks:
- directus
depends_on: