Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Docker service restart policy added (#101)

Jaseem Jas1bd31b8c8b35
diff --git a/docker/docker-compose-dev-essentials.yaml b/docker/docker-compose-dev-essentials.yaml
index da1a76980..a10863ecc 100644
--- a/docker/docker-compose-dev-essentials.yaml
+++ b/docker/docker-compose-dev-essentials.yaml
@@ -4,6 +4,7 @@ services:
db:
image: 'postgres:15.6'
container_name: unstract-db
+ restart: always
# set shared memory limit when using docker-compose
shm_size: 128mb
ports:
@@ -15,7 +16,7 @@ services:
- ./essentials.env
labels:
- traefik.enable=false
- restart: always
+
redis:
image: "redis:7.2.3"
container_name: unstract-redis
@@ -33,6 +34,7 @@ services:
image: 'minio/minio:latest'
container_name: unstract-minio
hostname: minio
+ restart: always
ports:
- '9000:9000'
- '9001:9001'
@@ -50,6 +52,7 @@ services:
# The official v2 Traefik docker image
image: traefik:v2.10
container_name: unstract-proxy
+ restart: always
# - Enables the web UI.
# - Tells Traefik to use docker and file providers.
# - Direct Traefik to the correct network for docker provider.
@@ -99,6 +102,7 @@ services:
- optional
image: downloads.unstructured.io/unstructured-io/unstructured-api:0.0.61
container_name: unstract-unstructured-io
+ restart: always
ports: # Forwarded to available host ports
- "8083:8000"
labels:
@@ -108,6 +112,7 @@ services:
# Vector DB for doc indexer
image: 'qdrant/qdrant'
container_name: unstract-vector-db
+ restart: always
ports:
- "6333:6333"
volumes:
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index 49005993e..86e88b054 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -7,6 +7,7 @@ services:
backend:
image: unstract/backend:${VERSION}
container_name: unstract-backend
+ restart: unless-stopped
command: migrate
ports:
- "8000:8000"
@@ -35,6 +36,7 @@ services:
execution-consumer:
image: unstract/backend:${VERSION}
container_name: unstract-execution-consumer
+ restart: unless-stopped
entrypoint: /app/.venv/bin/celery
command: "-A backend worker --loglevel=info"
env_file:
@@ -52,6 +54,7 @@ services:
celery-flower:
image: unstract/backend:${VERSION}
container_name: unstract-celery-flower
+ restart: unless-stopped
entrypoint: .venv/bin/celery
command: "-A backend flower --port=5555"
env_file:
@@ -72,12 +75,12 @@ services:
celery-beat:
image: unstract/backend:${VERSION}
container_name: unstract-celery-beat
+ restart: unless-stopped
entrypoint: .venv/bin/celery
command: "-A backend beat --scheduler django_celery_beat.schedulers:DatabaseScheduler -l INFO"
env_file:
- ../backend/.env
- ./essentials.env
- restart: on-failure
depends_on:
- db
- redis
@@ -86,6 +89,7 @@ services:
frontend:
image: unstract/frontend:${VERSION}
container_name: unstract-frontend
+ restart: unless-stopped
ports:
- "3000:3000"
depends_on:
@@ -100,6 +104,7 @@ services:
platform-service:
image: unstract/platform-service:${VERSION}
container_name: unstract-platform-service
+ restart: unless-stopped
ports:
- "3001:3001"
env_file:
@@ -113,6 +118,7 @@ services:
prompt-service:
image: unstract/prompt-service:${VERSION}
container_name: unstract-prompt-service
+ restart: unless-stopped
depends_on:
- db
ports:
@@ -125,6 +131,7 @@ services:
x2text-service:
image: unstract/x2text-service:${VERSION}
container_name: unstract-x2text-service
+ restart: unless-stopped
ports:
- "3004:3004"
env_file:
@@ -137,6 +144,7 @@ services:
worker:
image: unstract/worker:${VERSION}
container_name: unstract-worker
+ restart: unless-stopped
ports:
- 5002:5002
env_file:
@@ -155,6 +163,7 @@ services:
- optional
image: unstract/document-service:${VERSION}
container_name: unstract-document-service
+ restart: unless-stopped
ports:
- 3002:3002
depends_on:
diff --git a/run-platform.sh b/run-platform.sh
index 74b243bc3..6ed3519f9 100755
--- a/run-platform.sh
+++ b/run-platform.sh
@@ -100,13 +100,12 @@ parse_args() {
}
setup_env() {
+ # Generate Fernet Key. Refer https://pypi.org/project/cryptography/. for both backend and platform-service.
+ ENCRYPTION_KEY=$(python3 -c "import secrets, base64; print(base64.urlsafe_b64encode(secrets.token_bytes(32)).decode())")
for service in "${services[@]}"; do
sample_env_path="$script_dir/$service/sample.env"
env_path="$script_dir/$service/.env"
- # Generate Fernet Key. Refer https://pypi.org/project/cryptography/.
- ENCRYPTION_KEY=$(python3 -c "import secrets, base64; print(base64.urlsafe_b64encode(secrets.token_bytes(32)).decode())")
-
if [ -e "$sample_env_path" ] && [ ! -e "$env_path" ]; then
cp "$sample_env_path" "$env_path"
# Add encryption secret for backend and platform-service.