Skip to content

Commit 743a918

Browse files
committed
🔧 Edit Dockerfile stuff and disable docs & openapi spec
1 parent 3d15b37 commit 743a918

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

Dockerfile

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
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
102
WORKDIR /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
186
ENV PYTHONUNBUFFERED 1
197
ENV PYTHONDONTWRITEBYTECODE 1
20-
21-
COPY requirements.txt .
8+
ADD requirements.txt /app/requirements.txt
229
RUN 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/
2614
RUN 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
2918
USER appuser
19+
3020
HEALTHCHECK CMD curl --fail http://localhost:8000/v1/health || exit 1
21+
EXPOSE 8000
3122

32-
CMD ["fastapi", "run"]
23+
ENTRYPOINT ["fastapi"]
24+
CMD ["run"]

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
load_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
2020
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")

0 commit comments

Comments
 (0)