some docker info
This commit is contained in:
parent
b9fb66069d
commit
f3f3a6c216
4 changed files with 59 additions and 0 deletions
|
@ -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
15
docker/Makefile
Normal 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
6
docker/README
Normal 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.
|
||||
|
20
docker/docker-compose.yaml
Normal file
20
docker/docker-compose.yaml
Normal 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
|
Loading…
Add table
Reference in a new issue