3
votes

I am trying to deploy a multi-container web application to Azure App Services. The application runs fine from the images on my local machine however when I try to run it on app services it does not work and there are no error messages. In the logs section it says, "error retrieving logs."

Image of error

Bellow is the YAML for my docker compose file, I have tried various different version of this, but I am never able to get any error messages from Azure.

What am I doing wrong? How do I get Docker logs from Azure app services?

version: '3.7'
services:
  web:
    image: ptd_reports_app
    command: gunicorn TransitData.wsgi:application --bind 0.0.0.0:8000
    volumes:
      - static_volume:/home/PublicTransitDataReportingPortal/web/staticfiles
    expose:
      - 8000
    restart: always
    environment:
       DEBUG=1
       SECRET_KEY=<secret key>
       DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
       EMAIL_HOST_PASSWORD=<email password>
  nginx:
    image: ptd_reports_nginx
    restart: always
    volumes:
      - static_volume:/home/PublicTransitDataReportingPortal/web/staticfiles
    ports:
      - 1337:80
    depends_on:
      - web
volumes:
  static_volume:
2

2 Answers

1
votes

What am I doing wrong?

< sarcasm >You are using Azure< / sarcasm>

I found this entry when dealing with the same issue. Basically you need to have port 80 or 8080 exposed (other ports are ignored), and use the correct syntax:

  ports:
  - "80:80"

And there is only a tiny subset of all docker-compose options actually working according to the Azure documentation:

0
votes

You may check the Docker logs in the LogFiles directory. You can access this directory either through your SCM site or via FTP. Reference: https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-intro#troubleshooting