Azure app services - Docker compose multi container app - no Docker logs
Asked Answered
M

1

10

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:
Metametabel answered 29/10, 2019 at 21:14 Comment(0)
D
5

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.

Dominy answered 13/10, 2021 at 15:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.