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

Docker compose environment variables not taking?

Open public-handle opened this issue 9 months ago • 2 comments

:question: Question

apprise-api
  image:  caronc/apprise:latest
  container_name: apprise-api
  restart: unless-stopped
  environment:
    - PUID=${PUID}
    - PGID=${PGID}
    - APPRISE_DEFAULT_THEME=dark
    - APPRISE_STATEFUL_MODE=simple
    - APPRISE_ALLOW_CONFIG_LIST=true
    - APPRISE_ADMIN_ENABLED=true
    - LOG_LEVEL=debug
  volumes:
    - ${BASE_DIR}/apprise-api/config:/config
  ports:
    - 8013:8000

Maybe I'm just going about this all wrong but I'm trying to self host it by doing the above which works. I can access it on port 8013 and use it just fine. But none of the environment variables listed here work.

But maybe that's simply because I'm running apprise and not apprise-api but the confusing thing to me is the docker hub documentation for apprise is for apprise-api which doesn't line up with the github link I posted above which makes me even more confused as to what's going on.

Anyone able to shed some light and clarify how this all works for someone that wants to self host and run it in docker properly?

public-handle avatar May 11 '25 15:05 public-handle

I don't think the YAML files support environment variables. The examples where this is used on my GitHub and Docker page are when you're starting the container directly (using docker, not docker compose

Just swap your variables to what you want them to be in the .yaml file

caronc avatar May 11 '25 15:05 caronc

I THINK I get what is going on now, can you confirm my understanding please.

In order to run apprise-api properly, I will need to clone this repo, update the environment variables here, build and run it locally.

If that is correct then can I ask why this isn't setup to be able to be deployed as it's own self-hostable service using docker-compose? Am I just abusing this project or is that something that would make sense?

public-handle avatar May 11 '25 15:05 public-handle

In order to run apprise-api properly, I will need to clone this repo, update the environment variables

No, you don't need to use the git repo directly. The docker image is fully functional. I do understand where you got confused and this issue is rather old. I'm posting for posterity!

If I had to guess, I think your PUID and PGID are wrong

Here is my actual running docker compose effort:

# JG 9 Sep 2025

services:
  apprise:
    image: caronc/apprise:latest
    container_name: apprise
    environment:
      - PUID=998
      - PGID=997
      - TZ=Europe/London
      - APPRISE_ATTACH_SIZE=200
      - APPRISE_STATEFUL_MODE=simple
      - APPRISE_DEFAULT_CONFIG_ID=blueloop
    volumes:
      - /srv/apprise/config:/config
      - /srv/apprise/plugin:/plugin
      - /srv/apprise/attach:/attach
      - /srv/apprise/override.conf:/etc/nginx/location-override.conf:ro
      - /srv/apprise/apprise_api.htpasswd:/etc/nginx/.htpasswd:ro 
    ports:
      - 10.77.11.35:6060:8000
    restart: unless-stopped

You will have to make a few changes!

My Apprise API runs from a directory called /srv/apprise and in there I created the above docker-compose.yml. I created a system user and group called apprise-api and on my system they ended up with uid 998 and 997

I also created those sub dirs mentioned in volumes: and I set ownership to the system user I created.

Note that the default PUID/GUID for Apprise is 1000 and that matches with the initial admin user on Ubuntu and probably other distros too so don't get too wound up about this bit. Remove those entries - it will probably work. The documentation makes suggestions using docker (without compose) and a shell variable substitution which is probably confusing a lot of people. Check your current uid/gid with:

$ id my_user_name

Under ports, I've bound the external face of the container to 10.77.11.35 and port 6060. Those are my choices and allow me to use firewall rules to do stuff. To get started, change that to 8000:8000

The last two entries under volumes: are to make changes to the nginx proxy that fronts the container and enables authentication. Comment them out for now to get up and running.

Set your own timezone and you probably don't want my company name for your initial configuration!

# docker compose up -d
# docker compose logs -f
# docker down

I'm quite new to Apprise too but mine has an Apache reverse proxy on the front (yes I know it has nginx in the container) and a HA proxy fronting that. It might sound a bit mad but I run quite a lot of systems and its basically Lego! There are very good reasons for all those layers. Apprise fits in nicely.

Good luck, y'all

gerdesj avatar Sep 10 '25 00:09 gerdesj

The latest version of Apprise-API is out which should handle most permission issues. Documentation in the main README.md has been updated to help.

Closing ticket.

caronc avatar Nov 24 '25 11:11 caronc