This repository has been archived by the owner on Mar 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for running the latest version of editor locally (#705)
Adds a docker-compose file that can be used to run the latest version of Libero Editor locally.
- Loading branch information
1 parent
21227cd
commit 5ea134e
Showing
9 changed files
with
171 additions
and
0 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,10 @@ | ||
{ | ||
"QueueConfigurations": [ | ||
{ | ||
"QueueArn": "http://localhost:4566/000000000000/EditorImportQueue", | ||
"Events": [ | ||
"s3:ObjectCreated:*" | ||
] | ||
} | ||
] | ||
} |
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 @@ | ||
#!/bin/bash | ||
|
||
echo "Initializing S3" | ||
declare -a BUCKETS=("s3-editor-source-bucket" "s3-editor-destination-bucket") | ||
for BUCKET in ${BUCKETS[@]}; do | ||
echo "- Creating Bucket '$BUCKET'" | ||
awslocal s3 mb s3://$BUCKET | ||
done |
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,7 @@ | ||
#!/bin/bash | ||
echo "Initializing SQS" | ||
awslocal sqs create-queue --queue-name EditorImportQueue | ||
echo 'SQS queue created' | ||
echo 'setting up bucket notifications' | ||
awslocal s3api put-bucket-notification-configuration --bucket s3-editor-source-bucket --notification-configuration file:///etc/localstackconf/notification.json | ||
echo 'bucket notifications ready' |
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,10 @@ | ||
#!/bin/bash | ||
|
||
echo "Provisioning S3" | ||
for ARTICLE in /tmp/articles/* | ||
do | ||
if [[ -f $ARTICLE ]]; then | ||
echo "- Adding '${ARTICLE##*/}' to Bucket 's3-editor-source-bucket'" | ||
awslocal s3 cp $ARTICLE s3://s3-editor-source-bucket/ | ||
fi | ||
done |
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,24 @@ | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
|
||
server_name localhost; | ||
|
||
location /api/v1 { | ||
rewrite /api/v1/(.*) /$1 break; | ||
proxy_pass http://${PREFIX}-article-store:8080/; | ||
proxy_set_header Host $host; | ||
proxy_redirect http://${PREFIX}-localstack:4566/ http://localhost:4566/; | ||
} | ||
|
||
location / { | ||
proxy_pass http://${PREFIX}-client:80/; | ||
proxy_set_header Host $host; | ||
} | ||
|
||
} | ||
} |
File renamed without changes.
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
Binary file not shown.
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,79 @@ | ||
version: '3.5' | ||
|
||
services: | ||
localstack: | ||
image: localstack/localstack | ||
container_name: ${PREFIX-editor}-localstack | ||
restart: unless-stopped | ||
environment: | ||
- SERVICES=s3,sqs | ||
volumes: | ||
- './.localstack/startup:/docker-entrypoint-initaws.d:ro' | ||
- './.localstack/config:/etc/localstackconf:ro' | ||
- './articles:/tmp/articles:ro' | ||
ports: | ||
- 4566:4566 | ||
healthcheck: | ||
test: 'echo -e "GET /health\n\n" | nc ${PREFIX-editor}-localstack 4566' | ||
interval: 1m | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 60s | ||
|
||
mongo: | ||
image: mongo | ||
container_name: ${PREFIX-editor}-mongo | ||
restart: unless-stopped | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=root | ||
- MONGO_INITDB_ROOT_PASSWORD=password | ||
ports: | ||
- 27017:27017 | ||
healthcheck: | ||
test: echo 'db.runCommand("ping").ok' | mongo ${PREFIX-editor}-mongo:27017/test --quiet | ||
interval: 10s | ||
timeout: 10s | ||
retries: 3 | ||
start_period: 20s | ||
|
||
editor-article-store: | ||
image: liberoadmin/editor-article-store:${TAG-latest} | ||
container_name: ${PREFIX-editor}-article-store | ||
restart: unless-stopped | ||
depends_on: | ||
- mongo | ||
- localstack | ||
environment: | ||
- PORT=8080 | ||
- DB_ENDPOINT=${PREFIX-editor}-mongo:27017 | ||
- DB_NAME=editor | ||
- DB_USER=root | ||
- DB_PASSWORD=password | ||
- AWS_REGION=eu-west-1 | ||
- AWS_ACCESS_KEY=key | ||
- AWS_SECRET_ACCESS_KEY=secret | ||
- AWS_BUCKET_INPUT_EVENT_QUEUE_URL=http://${PREFIX-editor}-localstack:4566/000000000000/EditorImportQueue | ||
- AWS_ENDPOINT=http://${PREFIX-editor}-localstack:4566 | ||
- AWS_SRC_BUCKET=s3-editor-source-bucket | ||
- AWS_EDITOR_BUCKET=s3-editor-destination-bucket | ||
|
||
editor-client: | ||
image: liberoadmin/editor-client:${TAG-latest} | ||
container_name: ${PREFIX-editor}-client | ||
restart: unless-stopped | ||
depends_on: | ||
- editor-article-store | ||
|
||
nginx: | ||
image: nginx:alpine | ||
container_name: ${PREFIX-editor}-nginx | ||
depends_on: | ||
- editor-article-store | ||
- editor-client | ||
environment: | ||
- PREFIX=${PREFIX-editor} | ||
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx | ||
volumes: | ||
- './.nginx:/etc/nginx/templates' | ||
ports: | ||
- ${PORT-4000}:80 |