Skip to content

Instantly share code, notes, and snippets.

@cloudbow
Last active September 30, 2019 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudbow/46b40ddaf6ac58701b26d4d81b374948 to your computer and use it in GitHub Desktop.
Save cloudbow/46b40ddaf6ac58701b26d4d81b374948 to your computer and use it in GitHub Desktop.
Gunicorn reload not working
# Introduction
I have created a Dockerfile which solves the problem of Gunicorn not doing relaods. It just needs the inotify tools as well as the
pip module. This solves the problem of reloading the fullstack couchbase python in PyCharm.
```
FROM tiangolo/uvicorn-gunicorn:python3.7
LABEL maintainer="Arun George <arun.georg@xyz.com>"
# Dependencies for Couchbase
RUN wget -O - http://packages.couchbase.com/ubuntu/couchbase.key | apt-key add -
RUN echo "deb http://packages.couchbase.com/ubuntu stretch stretch/main" > /etc/apt/sources.list.d/couchbase.list
RUN apt-get update && \
apt-get install -y libcouchbase-dev libcouchbase2-bin build-essential
RUN apt-get install inotify-tools -y
COPY requirements.txt /tmp
RUN pip install --ignore-installed -r /tmp/requirements.txt
COPY ./app /app/app
COPY prestart.sh /app
```
#! /usr/bin/env bash
# Let the DB start
python /app/app/backend_pre_start.py
# Dev/Development
poll
inotify
celery~=4.3
passlib[bcrypt]
tenacity
requests
couchbase
nltk
emails
fastapi>=0.16.0
uvicorn
gunicorn
sklearn
pyjwt
python-multipart
email_validator
jinja2
boto3
s3fs
awscli
mlflow==1.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment