Skip to content

Commit 08da39f

Browse files
Refactor Docker configuration for improved environment variable handling and update template metadata
1 parent 91a88e6 commit 08da39f

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ services:
55
build: .
66
environment:
77
- DB_NAME=brawlstars_matches
8-
- DB_USER=postgres # Match your Unraid PostgreSQL container's user
9-
- DB_PASSWORD=${DB_PASSWORD} # Will be set in Unraid
10-
- DB_HOST=postgres # Network name of your PostgreSQL container
11-
- DB_PORT=5432
8+
- DB_USER=${DB_USER:-postgres}
9+
- DB_PASSWORD=${DB_PASSWORD}
10+
- DB_HOST=${DB_HOST:-192.168.1.100} # Default can be overridden
11+
- DB_PORT=${DB_PORT:-5432}
1212
- UPDATE_INTERVAL=600
1313
- LOG_LEVEL=INFO
1414
- REQUESTS_PER_MINUTE=30
@@ -18,9 +18,9 @@ services:
1818
- /mnt/user/appdata/liquipedia-poller/logs:/app/logs
1919
- /mnt/user/appdata/liquipedia-poller/data:/app/data
2020
restart: unless-stopped
21-
network_mode: bridge # Use bridge network to connect to other containers
21+
network_mode: bridge
2222
healthcheck:
23-
test: ["CMD", "python", "-c", "import psycopg2; psycopg2.connect(dbname='brawlstars_matches', user='postgres', password='${DB_PASSWORD}', host='postgres', port=5432)"]
23+
test: ["CMD", "python", "-c", "import psycopg2; psycopg2.connect(dbname='${DB_NAME}', user='${DB_USER}', password='${DB_PASSWORD}', host='${DB_HOST}', port=${DB_PORT})"]
2424
interval: 30s
2525
timeout: 10s
2626
retries: 3

template.xml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0"?>
22
<Container version="2">
33
<Name>liquipedia-poller</Name>
4-
<Repository>your-docker-hub-username/liquipedia-poller</Repository>
5-
<Registry>https://hub.docker.com/r/your-docker-hub-username/liquipedia-poller/</Registry>
4+
<Repository>ghcr.io/maximilianspitzer/liquipedia-poller</Repository>
5+
<Registry>https://github.com/maximilianspitzer/liquipedia-poller/pkgs/container/liquipedia-poller</Registry>
66
<Network>bridge</Network>
77
<Privileged>false</Privileged>
8-
<Support>https://github.com/your-username/liquipedia-poller</Support>
9-
<Project>https://github.com/your-username/liquipedia-poller</Project>
10-
<Overview>Service that polls Liquipedia for Brawl Stars esports statistics and maintains a database.</Overview>
11-
<Category>Tools: Status:Stable</Category>
8+
<Support>https://github.com/maximilianspitzer/liquipedia-poller</Support>
9+
<Project>https://github.com/maximilianspitzer/liquipedia-poller</Project>
10+
<Overview>Service that polls Liquipedia for Brawl Stars esports statistics and maintains a PostgreSQL database.</Overview>
11+
<Category>GameServers:</Category>
1212
<WebUI/>
1313
<TemplateURL/>
1414
<Icon>https://liquipedia.net/commons/images/thumb/5/53/Brawl_Stars_Logo_2019.png/600px-Brawl_Stars_Logo_2019.png</Icon>
@@ -17,13 +17,12 @@
1717
<CPUset/>
1818
<DonateText/>
1919
<DonateLink/>
20-
<Description>Service that polls Liquipedia for Brawl Stars esports statistics and maintains a database for use by other services.</Description>
2120
<Config Name="Database Name" Target="DB_NAME" Default="brawlstars_matches" Mode="" Description="PostgreSQL database name" Type="Variable" Display="always" Required="true" Mask="false"/>
2221
<Config Name="Database User" Target="DB_USER" Default="postgres" Mode="" Description="PostgreSQL username" Type="Variable" Display="always" Required="true" Mask="false"/>
2322
<Config Name="Database Password" Target="DB_PASSWORD" Default="" Mode="" Description="PostgreSQL password" Type="Variable" Display="always" Required="true" Mask="true"/>
24-
<Config Name="Database Host" Target="DB_HOST" Default="postgres" Mode="" Description="PostgreSQL host (container name)" Type="Variable" Display="always" Required="true" Mask="false"/>
23+
<Config Name="Database Host" Target="DB_HOST" Default="" Mode="" Description="Host IP or container name of your PostgreSQL instance (e.g., 192.168.1.100 or postgres-container)" Type="Variable" Display="always" Required="true" Mask="false"/>
2524
<Config Name="Database Port" Target="DB_PORT" Default="5432" Mode="" Description="PostgreSQL port" Type="Variable" Display="always" Required="true" Mask="false"/>
26-
<Config Name="Update Interval" Target="UPDATE_INTERVAL" Default="600" Mode="" Description="How often to check for updates (in seconds)" Type="Variable" Display="advanced" Required="false" Mask="false"/>
25+
<Config Name="Update Interval" Target="UPDATE_INTERVAL" Default="600" Mode="" Description="How often to check for updates (in seconds, default 10 minutes)" Type="Variable" Display="advanced" Required="false" Mask="false"/>
2726
<Config Name="Log Level" Target="LOG_LEVEL" Default="INFO" Mode="" Description="Logging level (DEBUG, INFO, WARNING, ERROR)" Type="Variable" Display="advanced" Required="false" Mask="false"/>
2827
<Config Name="Logs Path" Target="/app/logs" Default="/mnt/user/appdata/liquipedia-poller/logs" Mode="rw" Description="Container Path: /app/logs" Type="Path" Display="advanced" Required="true" Mask="false"/>
2928
<Config Name="Data Path" Target="/app/data" Default="/mnt/user/appdata/liquipedia-poller/data" Mode="rw" Description="Container Path: /app/data" Type="Path" Display="advanced" Required="true" Mask="false"/>

0 commit comments

Comments
 (0)