From 310fdfe942727be4686086091bcbba9138851cf3 Mon Sep 17 00:00:00 2001 From: Reinder Vos de Wael Date: Thu, 16 Jan 2025 09:31:48 -0500 Subject: [PATCH] feat: Allow changing the exposed port of the container. (#10) --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index abceab4..29e0c79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.11-alpine +ENV PORT=8000 RUN pip install poetry WORKDIR /app @@ -8,6 +9,6 @@ COPY src src RUN poetry install --no-cache -EXPOSE 8000 +EXPOSE $PORT -CMD ["poetry", "run", "uvicorn", "cloaiservice.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +CMD ["sh", "-c", "poetry run uvicorn cloaiservice.main:app --host 0.0.0.0 --port $PORT"] \ No newline at end of file