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 1
1
FROM 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
10
2
WORKDIR /app
11
3
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
18
6
ENV PYTHONUNBUFFERED 1
19
7
ENV PYTHONDONTWRITEBYTECODE 1
20
-
21
- COPY requirements.txt .
8
+ ADD requirements.txt /app/requirements.txt
22
9
RUN pip install -r requirements.txt
23
10
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/
26
14
RUN mkdir /app/cache
27
- RUN adduser -u 9263 --disabled-password --gecos "" appuser && chown -R appuser /app
28
15
16
+ # ADDING USER
17
+ RUN adduser -u 9263 --disabled-password --gecos "" appuser && chown -R appuser /app
29
18
USER appuser
19
+
30
20
HEALTHCHECK CMD curl --fail http://localhost:8000/v1/health || exit 1
21
+ EXPOSE 8000
31
22
32
- CMD ["fastapi" , "run" ]
23
+ ENTRYPOINT ["fastapi" ]
24
+ CMD ["run" ]
Original file line number Diff line number Diff line change 14
14
15
15
load_dotenv ()
16
16
17
- app = FastAPI ()
17
+ app = FastAPI (docs_url = None , redoc_url = None , openapi_url = None )
18
18
19
19
# auth with a bearer api key, whose hash is stored in the environment variable API_KEY_HASH
20
20
oauth2_scheme = OAuth2PasswordBearer (tokenUrl = "token" )
You can’t perform that action at this time.
0 commit comments