File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Original file line number Diff line number Diff line change 11FROM python:3.11-slim-bookworm
2-
3- # Keeps Python from generating .pyc files in the container
4- ENV PYTHONDONTWRITEBYTECODE=1
5-
6- # Turns off buffering for easier container logging
7- ENV PYTHONUNBUFFERED=1
8-
9- # we move to the app folder and run the pip install command
102WORKDIR /app
113
12- # Install system dependencies
13- RUN apt-get update && \
14- apt-get install -y \
15- curl \
16- build-essential
17-
4+ # INSTALLING DEPENDENCIES
5+ RUN apt-get update && apt-get install -y curl build-essential
186ENV PYTHONUNBUFFERED 1
197ENV PYTHONDONTWRITEBYTECODE 1
20-
21- COPY requirements.txt .
8+ ADD requirements.txt /app/requirements.txt
229RUN pip install -r requirements.txt
2310
24- COPY app.py /app/app.py
25- COPY ./src /app/
11+ # ADDING FILES
12+ ADD app.py /app/app.py
13+ ADD ./src /app/
2614RUN mkdir /app/cache
27- RUN adduser -u 9263 --disabled-password --gecos "" appuser && chown -R appuser /app
2815
16+ # ADDING USER
17+ RUN adduser -u 9263 --disabled-password --gecos "" appuser && chown -R appuser /app
2918USER appuser
19+
3020HEALTHCHECK CMD curl --fail http://localhost:8000/v1/health || exit 1
21+ EXPOSE 8000
3122
32- CMD ["fastapi" , "run" ]
23+ ENTRYPOINT ["fastapi" ]
24+ CMD ["run" ]
Original file line number Diff line number Diff line change 1414
1515load_dotenv ()
1616
17- app = FastAPI ()
17+ app = FastAPI (docs_url = None , redoc_url = None , openapi_url = None )
1818
1919# auth with a bearer api key, whose hash is stored in the environment variable API_KEY_HASH
2020oauth2_scheme = OAuth2PasswordBearer (tokenUrl = "token" )
You can’t perform that action at this time.
0 commit comments