Skip to content

Commit

Permalink
Set up for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
bbtufty committed Oct 1, 2024
1 parent d98b6db commit 0d8f792
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:latest
WORKDIR /app
COPY . /app
RUN pip install -e .

ENV CONFIG_DIR=/config
ENV DOCKER_ENV=true

ENTRYPOINT ["python", "nxbrew_watcher.py"]
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
[![Actions](https://img.shields.io/github/actions/workflow/status/bbtufty/nxbrew-watcher/build.yaml?branch=main&style=flat-square)](https://github.com/bbtufty/nxbrew-watcher/actions)
[![License](https://img.shields.io/badge/license-GNUv3-blue.svg?label=License&style=flat-square)](LICENSE)

Intro text
NXBrew-watcher is a Docker container designed to watch NXBrew for additions and updates, and push them through to
a Discord server.

Installation
------------
Usage
-----

NXBrew-watcher can be installed by cloning the repository and installing via pip:

```shell
git clone https://github.com/bbtufty/nxbrew-watcher.git
cd nxbrew-watcher
pip install -e .
```

Running NXBrew-watcher
----------------------
The easiest way to run NXBrew-watcher is through docker-compose:

After installing, you can run simply by:

```python
import os
os.system(r"python nxbrew-watcher\nxbrew_watcher.py")
```
services:
nxbrew-watcher:
image: nxbrew-watcher:latest
container_name: nxbrew-watcher
network_mode: bridge
environment:
- NXBREW_DISCORD_URL=https://some/webhook/url #optional
- NXBREW_CADENCE=1 #optional
- NXBREW_LOG_LEVEL=INFO #optional
volumes:
- path/to/config:/config
restart: unless-stopped
```

Environment variables
---------------------

NXBrew-watcher pulls in a number of environment variables that can be configured. These are:

* `CONFIG_DIR`: Where to save cache and log files to
* `NXBREW_DISCORD_URL`: Webhook URL for Discord to post updates (see [here](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks))
* `NXBREW_CADENCE`: Cadence to perform search on (in minutes). Defaults to 1.
* `NXBREW_LOG_LEVEL`: Level for log files. Defaults to INFO

0 comments on commit 0d8f792

Please sign in to comment.