Skip to content

Commit 691027d

Browse files
committed
#63 fix libmagic old deps and celery fix
1 parent b7a22d7 commit 691027d

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ services:
3131
dockerfile: dev.Dockerfile
3232
entrypoint: /app/scripts/entrypoint.sh
3333
environment:
34+
- APP_TYPE=celery
3435
- OLLAMA_HOST=${OLLAMA_HOST-http://ollama:11434}
3536
- CELERY_BROKER_URL=${CELERY_BROKER_URL-redis://redis:6379/0}
3637
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND-redis://redis:6379/0}

scripts/entrypoint.sh

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,28 @@
33
PYPROJECT_HASH_FILE=".pyproject.hash"
44
CURRENT_HASH=$(sha256sum pyproject.toml | awk '{ print $1 }')
55

6-
76
if [ ! -d ".dvenv" ] || [ ! -f "$PYPROJECT_HASH_FILE" ] || [ "$(cat $PYPROJECT_HASH_FILE)" != "$CURRENT_HASH" ]; then
8-
echo "Dependencies have changed or .dvenv is missing. Reinstalling..."
9-
python -m venv .dvenv
10-
source .dvenv/bin/activate
11-
pip install --upgrade pip setuptools
12-
pip install .
13-
echo "$CURRENT_HASH" > "$PYPROJECT_HASH_FILE"
7+
echo "Dependencies have changed or .dvenv is missing. Reinstalling..."
8+
python -m venv .dvenv
9+
source .dvenv/bin/activate
10+
pip install --upgrade pip setuptools
11+
pip install .
12+
echo "$CURRENT_HASH" >"$PYPROJECT_HASH_FILE"
1413
else
15-
python3 -m venv --upgrade /app/.dvenv # temporary :(
16-
echo "Virtual environment is up to date."
14+
python3 -m venv --upgrade /app/.dvenv # temporary :(
15+
echo "Virtual environment is up to date."
1716
fi
1817

1918
source .dvenv/bin/activate
2019

2120
if [ "$APP_TYPE" = "celery" ]; then
22-
echo "Starting Celery worker..."
23-
exec celery -A text_extract_api.celery_app worker --loglevel=info --pool=solo
21+
echo "Starting Celery worker..."
22+
exec celery -A text_extract_api.celery_app worker --loglevel=info --pool=solo
2423
else
25-
echo "Starting FastAPI app..."
26-
if [ "$APP_ENV" = "production" ]; then
27-
exec uvicorn text_extract_api.main:app --host 0.0.0.0 --port 8000
28-
else
29-
exec uvicorn text_extract_api.main:app --host 0.0.0.0 --port 8000 --reload
30-
fi
24+
echo "Starting FastAPI app..."
25+
if [ "$APP_ENV" = "production" ]; then
26+
exec uvicorn text_extract_api.main:app --host 0.0.0.0 --port 8000
27+
else
28+
exec uvicorn text_extract_api.main:app --host 0.0.0.0 --port 8000 --reload
29+
fi
3130
fi

0 commit comments

Comments
 (0)