-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(api): Installation with pre-built Docker image (#70)
* feat: add Dockerfile and build script * docs(api): add installation instructions with pre-built Docker image
- Loading branch information
1 parent
04369a0
commit bf23190
Showing
4 changed files
with
112 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG DIRECTUS_VERSION=latest | ||
|
||
FROM node:20-alpine as extensions | ||
WORKDIR /extensions | ||
RUN npm install directus-extension-sync | ||
|
||
FROM --platform=${TARGETPLATFORM} directus/directus:${DIRECTUS_VERSION} | ||
COPY --from=extensions /extensions/node_modules/directus-extension-sync ./extensions/directus-extension-sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Docker image | ||
|
||
This Docker image extends the official Directus Docker images with the extension `directus-extension-sync` pre-installed. | ||
|
||
It can be used to quickly set up a Directus instance to use with the [`directus-sync` CLI](https://github.com/tractr/directus-sync). | ||
|
||
The `directus-sync` command-line interface (CLI) provides a set of tools for managing and synchronizing the schema and collections within Directus across different environments. | ||
|
||
## Usage | ||
|
||
### Run with Docker Compose | ||
|
||
Create a `docker-compose.yml` file with the following content: | ||
|
||
```yaml | ||
version: '3.8' | ||
|
||
services: | ||
directus: | ||
image: tractr/directus-sync:latest | ||
restart: unless-stopped | ||
ports: | ||
- '8055:8055' | ||
environment: | ||
KEY: 'XXXXXXXX' | ||
SECRET: 'XXXXXXXX' | ||
ADMIN_EMAIL: '[email protected]' | ||
ADMIN_PASSWORD: 'password' | ||
``` | ||
Then, run: | ||
```bash | ||
docker-compose up -d | ||
``` | ||
|
||
### Run with Docker | ||
|
||
Run the following command: | ||
|
||
```bash | ||
docker run -d -p 8055:8055 \ | ||
-e KEY=XXXXXXXX \ | ||
-e SECRET=XXXXXXXX \ | ||
-e [email protected] \ | ||
-e ADMIN_PASSWORD=password \ | ||
tractr/directus-sync:latest | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env zx | ||
|
||
const directusVersions = [ | ||
'latest', | ||
|
||
'10', | ||
|
||
'10.9', | ||
'10.9.0', | ||
'10.9.1', | ||
'10.9.2', | ||
'10.9.3', | ||
|
||
'10.10', | ||
'10.10.0', | ||
'10.10.1', | ||
'10.10.2', | ||
'10.10.3', | ||
'10.10.4', | ||
'10.10.5', | ||
'10.10.6', | ||
'10.10.7', | ||
|
||
'10.11', | ||
'10.11.0', | ||
]; | ||
|
||
const platforms = [ | ||
'linux/amd64', | ||
// 'linux/arm64', | ||
]; | ||
|
||
for (const version of directusVersions) { | ||
await $`docker buildx build \ | ||
-t tractr/directus-sync:${version} \ | ||
--build-arg DIRECTUS_VERSION=${version} \ | ||
--platform ${platforms.join(',')} .`; | ||
} | ||
|
||
for (const version of directusVersions) { | ||
await $`docker push tractr/directus-sync:${version}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters