我尝试使用docker将我的django REST应用程序部署到heroku . 但是我在Chrome控制台中收到以下错误:无法加载资源:服务器响应状态为503(服务不可用)/favicon.ico . 请帮我 . 我试过在互联网上试图找到它,但我没有找到确切的情况 .

Heroku Logs:

2018-03-31T00:11:34.645598 00:00 heroku [router]:at = error code = H10 desc =“App crashed”method = GET path =“/”host = peaceful-journey-46603.herokuapp.com request_id = f302df33-d8f5-493e-acc3-9876e62e6b1e fwd =“92.243.107.10”dyno = connect = service = status = 503 bytes = protocol = https 2018-03-31T00:11:35.739405 00:00 heroku [router]:at = error code = H10 desc =“App crashed”method = GET path =“/ favicon.ico”host = peaceful-journey-46603.herokuapp.com request_id = e92508cd-fcda-4aa2-b163-b048127782dc fwd =“92.243.107.10”dyno = connect = service = status = 503 bytes = protocol = https

2018-03-31T00:11:40.956628 00:00 heroku [router]:at = error code = H10 desc =“App crashed”method = GET path =“/ favicon.ico”host = peaceful-journey-46603.herokuapp . com request_id = e764b5be-2ecd-4d89-9c37-940330a89fec fwd =“92.243.107.10”dyno = connect = service = status = 503 bytes = protocol = https

2018-03-31T00:11:42.282073 00:00 heroku [router]:at = error code = H10 desc =“App crashed”method = GET path =“/ favicon.ico”host = peaceful-journey-46603.herokuapp . com request_id = 4f2b76d6-ed90-4deb-b4fd-6c5a4d95d7ff fwd =“92.243.107.10”dyno = connect = service = status = 503 bytes = protocol = https

2018-03-31T00:58:46.065190 00:00 heroku [router]:at = error code = H10 desc =“App crashed”method = GET path =“/”host = peaceful-journey-46603.herokuapp.com request_id = d0f5533d-eb96-4133-a996-f307c99cb387 fwd =“92.243.107.10”dyno = connect = service = status = 503 bytes = protocol = https

2018-03-31T00:58:47.659835 00:00 heroku [router]:at = error code = H10 desc =“App crashed”method = GET path =“/ favicon.ico”host = peaceful-journey-46603.herokuapp . com request_id = bd6eeee7-4e0c-45c5-b7a6-48e8aa0502e6 fwd =“92.243.107.10”dyno = connect = service = status = 503 bytes = protocol = https

2018-03-31T01:21:05.606596 00:00 heroku [web.1]:状态从崩溃变为开始

2018-03-31T01:21:30.451682 00:00 heroku [web.1]:使用命令 python3 启动进程

2018-03-31T01:21:34.767047 00:00 heroku [web.1]:进程退出状态为0

2018-03-31T01:21:34.886271 00:00 heroku [web.1]:状态从开始变为崩溃

Dockerfile:

FROM python:3
ENV PYTHONBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
COPY entrypoint.sh /entrypoint.sh
ADD . /code/

docker-compose.yml

version: '3.3'
services:
  db:
    container_name: "postgres"
    image: postgres
    ports:
      - "5432:5432"

    restart: always
    environment:
      POSTGRES_USER: "fbva"
      POSTGRES_PASSWORD: "111111"

  django_app:
    container_name: "django_app"
    build: .
    env_file:
      - "fbva/fbva/.env"
    restart: always
    volumes:
      - .:/code
    ports:
      - "8000:8000"
    depends_on:
      - db
    entrypoint:
      - ./entrypoint.sh
    environment:
      - PYTHONUNBUFFERED=0

entrypoint.sh

#!/bin/bash

python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py collectstatic
python3 manage.py loaddata ./fixtures/language.json
python3 manage.py loaddata ./fixtures/interval.json
python3 manage.py loaddata ./fixtures/setting.json
python3 manage.py loaddata ./fixtures/user.json
python3 manage.py loaddata ./fixtures/card.json
python3 manage.py runserver 0.0.0.0:8000

exec "$@"

Deployed to Heroku using following commands:

heroku login
heroku container:login
heroku container:push web
heroku open

I've got this result