我有一个 wagtail Web 应用程序,它在本地主机中完美运行,但在生产中,调试设置为 False 并且所有静态文件都不会显示在部署的网站中,我附加了下面的 Dockerfile 代码:
# Use an official Python runtime as a parent image
FROM python:3.7
LABEL maintainer="hello@wagtail.io"
# Set environment varibles
ENV PYTHONUNBUFFERED 1
ENV DJANGO_ENV production
COPY ./requirements.txt /code/requirements.txt
RUN pip install --upgrade pip
# Install any needed packages specified in requirements.txt
RUN pip install -r /code/requirements.txt
RUN pip install gunicorn
# Copy the current directory contents into the container at /code/
COPY . /code/
# Set the working directory to /code/
WORKDIR /code/ …Run Code Online (Sandbox Code Playgroud) django gunicorn google-cloud-platform wagtail google-cloud-run