因此,我已将我的应用程序部署到 azure 应用程序服务,并使用在 Alpine 上运行的自定义 docker 容器,但是当我通过 SSH 连接到 bash 时,所有配置的环境变量都不可用。应用程序入口点本身可以看到所有变量并且应用程序正确运行。我能够在微软文档中挖掘到的信息说所有配置变量都应该被传递下来,但不知何故它们不是......欢迎任何建议
这是一篇类似于我的问题的帖子,但它也没有提供任何解决方案。
这是我的 dockerfile
# pull official base image
FROM python:3.7-alpine AS build-python
# Copy over and install requirements files
RUN mkdir requirements
COPY requirements/production.txt /requirements/
COPY requirements/common.txt /requirements/
COPY ./requirements.txt /
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /wheels -r requirements.txt
FROM python:3.7-alpine
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBUG 0
ENV DJANGOENV staging
# install psycopg2
RUN apk update \
&& apk add …Run Code Online (Sandbox Code Playgroud) containers environment-variables azure docker azure-web-app-service