Skip to content

Commit 7d8635f

Browse files
committed
Update
1 parent f1e0ac1 commit 7d8635f

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

Dockerfile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22

3-
FROM --platform=linux/amd64 python:3.9-slim-buster as environment
3+
FROM --platform=linux/amd64 python:3.9-slim-buster AS environment
44
ARG DEBIAN_FRONTEND=noninteractive
55

66
# Configure Poetry
77
ENV POETRY_VERSION=1.3.2
88
ENV POETRY_HOME=/app/poetry
99
ENV POETRY_VENV=/app/poetry-venv
10-
ENV PATH="/app/poetry-venv/bin:$PATH"
10+
ENV PATH="$POETRY_VENV/bin:$PATH"
1111
ENV POETRY_CACHE_DIR=/app/.cache
1212

1313
# Install poetry separated from system interpreter
@@ -19,8 +19,8 @@ RUN python3 -m venv $POETRY_VENV \
1919
ENV PATH="${PATH}:${POETRY_VENV}/bin"
2020

2121
# Set env variables
22-
ENV PYTHONDONTWRITEBYTECODE 1
23-
ENV PYTHONUNBUFFERED 1
22+
ENV PYTHONDONTWRITEBYTECODE=1
23+
ENV PYTHONUNBUFFERED=1
2424

2525
WORKDIR /app
2626

@@ -31,7 +31,7 @@ RUN /bin/bash -c 'source $POETRY_VENV/bin/activate && \
3131
poetry install --no-root'
3232

3333

34-
FROM --platform=linux/amd64 python:3.9-slim-buster as test
34+
FROM --platform=linux/amd64 python:3.9-slim-buster AS test
3535

3636
WORKDIR /app
3737
#COPY --from=indexing_environment $POETRY_VENV $POETRY_VENV
@@ -43,7 +43,7 @@ COPY . FN-Basic-Services
4343
ENTRYPOINT ["/app/FN-Basic-Services/docker-run-tests.sh"]
4444

4545

46-
FROM --platform=linux/amd64 python:3.9-slim-buster as runtime
46+
FROM --platform=linux/amd64 python:3.9-slim-buster AS runtime
4747

4848
WORKDIR /app
4949

@@ -52,11 +52,15 @@ COPY --from=environment /app .
5252
COPY . FN-Basic-Services
5353

5454
# Set env variables
55-
ENV PYTHONDONTWRITEBYTECODE 1
56-
ENV PYTHONUNBUFFERED 1
55+
ENV PYTHONDONTWRITEBYTECODE=1
56+
ENV PYTHONUNBUFFERED=1
57+
58+
# Configure Poetry
59+
ENV POETRY_VENV=/app/poetry-venv
60+
ENV PATH="$POETRY_VENV/bin:$PATH"
5761

5862
# Enable venv
59-
ENV PATH="/app/poetry-venv/bin:$PATH"
63+
ENV PATH="$POETRY_VENV/bin:$PATH"
6064

6165
# ENTRYPOINT ["/app/FN-Basic-Services/docker-run-entrypoints.sh"]
6266
# CMD ["gunicorn", "--bind", "0.0.0.0:8888", "main:app"]

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def custom_openapi():
6262
summary="Return Json")
6363
async def root():
6464
logger.info("/hello")
65-
return {"message": "Hello World from openapi.yml"}
65+
return {"message": "python-fastapi-openapi.yml k8s"}
6666

6767
'''
6868
@app.get("/test", tags=['API'],

0 commit comments

Comments
 (0)