Nick Slavsky
Nick Slavsky

Reputation: 1330

Gunicorn --reload is not working on Ubuntu with local repository

I've seen some questions like this and issues on GitHub, but wasn't able to get it to work. My setup is like this: I have the code locally on Ubuntu 16.04.3

├──+messenger
├── Dockerfile
├── docker-compose.yml

The contents of the docker-compose file is as follows:

version: '2'

services:
    messenger:
        build: .
        ports:
            - "5000:8000"
        command: >
          gunicorn -b 0.0.0.0:8000
            --access-logfile -
            --reload
            "app:app"
        volumes:
          - ".:/messenger"

And no matter what i change inside the messenger directory when the app is running, gunicorn never reloads.

I'm using python:3.6-alpine to build my image.

Upvotes: 3

Views: 2808

Answers (1)

Abylay Sabirgaliyev
Abylay Sabirgaliyev

Reputation: 726

Had the same issue recently. I was using python:2.7. But my mistake was not setting DEBUG = True in Django settings. You might want to enable Debug in Flask too. Here is similar question.

Upvotes: 1

Related Questions