Update Docker to accept REFRESH_INTERVAL as an environment variable
Signed-off-by: Jordan Doyle <jordan@doyle.la>
Diff
Dockerfile | 5 ++++-
README.md | 15 +++++++++++++++
docker-compose.override.yml.example | 2 ++
scripts/docker/entrypoint.sh | 8 ++++++++
4 files changed, 28 insertions(+), 2 deletions(-)
@@ -9,5 +9,8 @@
FROM debian:bullseye-slim
COPY --from=builder /sources/target/release/rgit /rgit
COPY ./scripts/docker/entrypoint.sh .
RUN chmod +x entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/rgit", "[::]:8000", "/git", "-d", "/tmp/rgit-cache.db"]
ENTRYPOINT ["/entrypoint.sh"]
@@ -33,7 +33,7 @@
Usage:
```
rgit 0.1.0
rgit 0.1.1
USAGE:
rgit --db-store <DB_STORE> <BIND_ADDRESS> <SCAN_PATH>
@@ -51,7 +51,11 @@
doesn't already exist
The Sled database is very quick to generate, so this can be pointed to temporary storage
--refresh-interval <REFRESH_INTERVAL>
Configures the metadata refresh interval (eg. "never" or "60s")
[default: 5m]
-h, --help
Print help information
@@ -132,6 +136,15 @@
An example override file has been has been provided with the repository. To use it, remove the
`.example` extension from `docker-compose.override.yml.example`, and adjust the UID and GID to
match the user that owns the directory containing your repositories.
To configure automatic refresh in Docker, an environment variable is also provided.
```
services:
rgit:
environment:
- REFRESH_INTERVAL=5m
```
Afterwards, bring up the container with `docker-compose up` to make sure everything works.
@@ -1,4 +1,6 @@
version: '3'
services:
rgit:
user: 1000:1000
environment:
- REFRESH_INTERVAL=5m
@@ -1,0 +1,8 @@
if [ -z ${REFRESH_INTERVAL+x} ];
then
./rgit [::]:8000 /git -d /tmp/rgit-cache.db;
else
./rgit [::]:8000 /git -d /tmp/rgit-cache.db --refresh-interval $REFRESH_INTERVAL;
fi