some docker info

This commit is contained in:
Arnas Udovic 2025-06-23 09:40:20 +03:00
parent b9fb66069d
commit f3f3a6c216
4 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,18 @@
FROM golang:1.24
WORKDIR /usr/src/app
ADD peertube-instance-index-filter ./
ADD instances.db ./
RUN go mod download && go mod verify
RUN go build -v -o /usr/local/bin/peertube-instance-index-filter ./...
ENV GIN_MODE release
RUN set -ex; \
echo '0 1 * * * /usr/local/bin/peertube-instance-index-filter -command collect' > /var/spool/cron/crontabs/root
CMD ["peertube-instance-index-filter"]

15
docker/Makefile Normal file
View file

@ -0,0 +1,15 @@
### help: Show help message (default target)
.PHONY: help
help:
@printf "%s\n\n" "make: List of possible targets:"
@grep '^### .*:' $(lastword $(MAKEFILE_LIST)) | sed 's/^### \([^:]*\): \(.*\)/\1:\t\2/' | column -ts "$$(printf '\t')"
### add-index: Add index host. Arguments: url and instance-url (optional)
.PHONY: add-index
add-index:
docker compose -f docker-compose.yaml exec -it peertube-instance-index-filter peertube-instance-index-filter -command index -url $(url) -instance-url $(instance-url)
### reject: Reject host. Arguments: host and reason (optional)
.PHONY: reject
reject:
docker compose -f docker-compose.yaml exec -it peertube-instance-index-filter peertube-instance-index-filter -command reject -host $(host) -reject-reason $(reason)

6
docker/README Normal file
View file

@ -0,0 +1,6 @@
Usualy I seperate git repo from Dockerfile, so I copy these docker files to same directory where repo is cloned. I serve it under traefik, so I added labels to composer.
`instances.db` should be copied, too.
`Makefile` is wrapper to add index hosts and reject hosts. Run `make help` for more info.

View file

@ -0,0 +1,20 @@
version: "3.9"
services:
peertube-instance-index-filter:
build: ./peertube-instance-index-filter
volumes:
- ./instances.db:/usr/src/app/instances.db
expose:
- 8081
labels:
- traefik.enable=true
- traefik.http.routers.peertube_instance_index.rule=Host(`index.tv.arns.lt`)
- traefik.http.routers.peertube_instance_index.tls.certresolver=le
- traefik.http.routers.peertube_instance_index.entrypoints=websecure
restart: always
networks:
default:
external:
name: traefik_default