Initial draft of the docker-compose

with configuration files
This commit is contained in:
Atom 2021-08-24 21:11:53 +02:00
parent c84060e2a4
commit 67ef453cfa
4 changed files with 131 additions and 0 deletions

41
config/Caddyfile Normal file
View File

@ -0,0 +1,41 @@
piped.domain.tld {
reverse_proxy pipedfrontend:80
}
pipedapi.domain.tld {
reverse_proxy varnish:80
}
pipedproxy.domain.tld {
@ytproxy path /videoplayback* /api/v4/* /api/manifest/*
@optionscall {
method OPTIONS
}
header Access-Control-Allow-Origin *
header Access-Control-Allow-Headers *
route {
header @ytproxy {
Cache-Control private always
CF-Connecting-IP ""
}
header / {
Cache-Control "public, max-age=604800"
-Access-Control-Allow-Origin
}
respond @optionscall 200
reverse_proxy unix//var/run/ytproxy/http-proxy.sock {
header_down -etag
header_down -alt-svc
}
}
}

25
config/config.properties Normal file
View File

@ -0,0 +1,25 @@
# The port to Listen on.
PORT: 8080
# The number of workers to use for the server
HTTP_WORKERS: 2
# Proxy
PROXY_PART: https://pipedproxy.domain.tld
# Outgoing HTTP Proxy - eg: 127.0.0.1:8118
#HTTP_PROXY: 127.0.0.1:8118
# Captcha Parameters
CAPTCHA_BASE_URL: https://api.capmonster.cloud/
CAPTCHA_API_KEY: INSERT_HERE
# Public API URL
API_URL: https://pipedapi.domain.tld
# Hibernate properties
hibernate.connection.url: jdbc:postgresql://postgres:5432/piped
hibernate.connection.driver_class: org.postgresql.Driver
hibernate.dialect: org.hibernate.dialect.PostgreSQL10Dialect
hibernate.connection.username: piped
hibernate.connection.password: changeme

5
config/default.vcl Normal file
View File

@ -0,0 +1,5 @@
vcl 4.0;
backend default {
.host = "piped:8080";
}

60
docker-compose.yml Normal file
View File

@ -0,0 +1,60 @@
services:
pipedfrontend:
image: 1337kavin/piped-frontend:latest
restart: unless-stopped
depends_on:
- piped
container_name: piped-frontend
ytproxy:
image: 1337kavin/ytproxy:latest
restart: unless-stopped
volumes:
- ./ytproxy:/app/socket
container_name: ytproxy
piped:
image: 1337kavin/piped:latest
restart: unless-stopped
volumes:
- ./config.properties:/app/config.properties
depends_on:
- ytproxy
- postgres
container_name: piped-backend
varnish:
image: varnish:6.6-alpine
restart: unless-stopped
volumes:
- ./default.vcl:/etc/varnish/default.vcl
container_name: varnish
caddy:
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy/config:/config
- ./ytproxy:/var/run/ytproxy
container_name: caddy
postgres:
image: postgres:13-alpine
restart: unless-stopped
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=piped
- POSTGRES_USER=piped
- POSTGRES_PASSWORD=changeme
container_name: postgres
watchtower:
image: containrrr/watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /etc/timezone:/etc/timezone:ro
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_INCLUDE_RESTARTING=true
container_name: watchtower
command: piped-frontend piped-backend ytproxy varnish caddy postgres watchtower