tiangolo / uvicorn-gunicorn-fastapi-docker

Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python with performance auto-tuning.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prestart script not found

wuxmax opened this issue · comments

Hello! My issue is that the script which I refer to via the PRE_START_PATH environment variable is not found:

❯ docker logs -f corona-faq-api_api_1
Checking for script in "/scripts/start-jupyter.sh"
There is no script "/scripts/start-jupyter.sh"

While I have no problem running it manually:

❯ docker exec -it corona-faq-api_api_1 bash
root@7b17f557d74a:/app# /scripts/start-jupyter.sh
root@7b17f557d74a:/app# [I 15:14:56.572 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 15:14:57.154 NotebookApp] Serving notebooks from local directory: /notebooks
[I 15:14:57.155 NotebookApp] Jupyter Notebook 6.2.0 is running at:
[I 15:14:57.155 NotebookApp] http://7b17f557d74a:8888/
[I 15:14:57.155 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

This is my corresponding docker-compose file:

version: "3"

services:
  es:
    image: elasticsearch:7.10.1
    # volumes:
    #   - ./elasticsearch-data:/usr/share/elasticsearch/data
    environment:
       - discovery.type=single-node
  
  api:
    build:
      context: ./api
      dockerfile: Dockerfile.prod
    depends_on:
      - es
    volumes:
      - ./embedding-models/:/models/
    environment:
       - PORT=$PROD_PORT
       - PRE_START_PATH="/scripts/start-jupyter.sh"
       - GRACEFUL_TIMEOUT=300
       - WEB_CONCURRENCY=2
    ports:
      - "$PROD_PORT:$PROD_PORT"
      - "$JUP_PORT:$JUP_PORT"

Am I blind or is there something broken?

I think that you have to rename it from start-jupyter.sh to prestart.sh