build(docker): update CMD to use shell for environment variable expansion in Dockerfiles

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-02-22 22:30:37 +08:00
parent 9b42dbfa7f
commit da584b8ffa
4 changed files with 7 additions and 4 deletions

View File

@ -35,4 +35,5 @@ COPY . ${CONTAINER_APP_ROOT}
#RUN ln -s /bin/bash /usr/bin/bash
EXPOSE ${SERVICE_API_ACCESS_PORT}
CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"]
# Using shell to expand environemnt to enure pass the actual environment value to uvicorn
CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST

View File

@ -35,4 +35,5 @@ COPY . ${CONTAINER_APP_ROOT}
#RUN ln -s /bin/bash /usr/bin/bash
EXPOSE ${SERVICE_API_ACCESS_PORT}
CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"]
# Using shell to expand environemnt to enure pass the actual environment value to uvicorn
CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST

View File

@ -34,4 +34,5 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . ${CONTAINER_APP_ROOT}
EXPOSE ${SERVICE_API_ACCESS_PORT}
CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"]
# Using shell to expand environemnt to enure pass the actual environment value to uvicorn
CMD uvicorn webapi.main:app --reload --port=$SERVICE_API_ACCESS_PORT --host=$SERVICE_API_ACCESS_HOST

View File

@ -29,5 +29,5 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . ${CONTAINER_APP_ROOT}
EXPOSE ${SERVICE_API_ACCESS_PORT}
#CMD ["uvicorn", "webapi.main:app", "--reload", "--port=${SERVICE_API_ACCESS_PORT}", "--host=${SERVICE_API_ACCESS_HOST}"]
# Using shell to expand environemnt to enure pass the actual environment value to uvicorn
CMD uvicorn webapi.main:app --reload --port=${SERVICE_API_ACCESS_PORT} --host=${SERVICE_API_ACCESS_HOST}