11
22
3- FROM --platform=linux/amd64 python:3.9.7 as environment
3+ FROM --platform=linux/amd64 python:3.9-slim-buster as environment
44ARG DEBIAN_FRONTEND=noninteractive
55
66# Configure Poetry
77ENV POETRY_VERSION=1.3.2
88ENV POETRY_HOME=/app/poetry
99ENV POETRY_VENV=/app/poetry-venv
10+ ENV PATH="/app/poetry-venv/bin:$PATH"
1011ENV POETRY_CACHE_DIR=/app/.cache
1112
1213# Install poetry separated from system interpreter
@@ -30,7 +31,7 @@ RUN /bin/bash -c 'source $POETRY_VENV/bin/activate && \
3031 poetry install --no-root'
3132
3233
33- FROM --platform=linux/amd64 python:3.9.7 as test
34+ FROM --platform=linux/amd64 python:3.9-slim-buster as test
3435
3536WORKDIR /app
3637# COPY --from=indexing_environment $POETRY_VENV $POETRY_VENV
@@ -42,13 +43,19 @@ COPY . FN-Basic-Services
4243ENTRYPOINT ["/app/FN-Basic-Services/docker-run-tests.sh" ]
4344
4445
45- FROM --platform=linux/amd64 python:3.9.7 as runtime
46+ FROM --platform=linux/amd64 python:3.9-slim-buster as runtime
4647
4748WORKDIR /app
49+
4850# COPY --from=indexing_environment $POETRY_VENV $POETRY_VENV
4951COPY --from=environment /app .
5052COPY . FN-Basic-Services
5153
52- # RUN chmod +x /app/FN-Basic-Services/*.sh
54+ # Enable venv
55+ ENV PATH="/app/poetry-venv/bin:$PATH"
56+
57+ # ENTRYPOINT ["/app/FN-Basic-Services/docker-run-entrypoints.sh"]
58+ # CMD ["gunicorn", "--bind", "0.0.0.0:8888", "main:app"]
5359
54- ENTRYPOINT ["/app/FN-Basic-Services/docker-run-entrypoints.sh" ]
60+ # Command to run Gunicorn with Uvicorn workers
61+ CMD ["gunicorn" , "-w" , "4" , "--worker-class" , "uvicorn.workers.UvicornWorker" , "-b" , "0.0.0.0:8888" , "-t" , "30" , "--pythonpath" , "/app/FN-Basic-Services" , "main:app" ]
0 commit comments