apprise-api icon indicating copy to clipboard operation
apprise-api copied to clipboard

always serve STATIC_ROOT, for users who don't want debug mode & don't want an nginx proxy stitching things together

Open drewp opened this issue 7 months ago • 0 comments

FYE, it seems to almost work to run just this and serve up port 8080:

gunicorn  -c  /opt/apprise/webapp/gunicorn.conf.py  -b  :8080  --worker-tmp-dir /dev/shm core.wsgi

This let me run local forks using pdm and k8s. The missing piece was the serving of STATIC_ROOT, so this PR enables static file serving all the time. I presume this harmless if you do have the ngnix proxy layer-- apprise-api simply won't get the requests.

For reference, Dockerfile:

WORKDIR /opt/apprise
RUN pdm init minimal --non-interactive
RUN pdm add django gevent gunicorn requests "paho-mqtt < 2.0.0" gntp cryptography django-prometheus

COPY apprise/ ./apprise/
RUN pdm add "/opt/apprise/apprise"

COPY apprise-api/apprise_api/ ./webapp/

k8s deployment:

      containers:
      - name: main
        image: reg:5000/apprise_image
        workingDir: /opt/apprise
        command: 
        - pdm
        - run
        - gunicorn 
        - -c 
        - /opt/apprise/webapp/gunicorn.conf.py 
        - -b 
        - :8080 
        - --worker-tmp-dir
        - /dev/shm
        - core.wsgi
        env:
          - name: APPRISE_CONFIG_DIR
            value: /config
          - name: APPRISE_WORKER_COUNT
            value: "2"
        volumeMounts:
         - {name: data, subPath: config, mountPath: /config}

drewp avatar May 11 '25 02:05 drewp