Compare commits
5 Commits
dev-franke
...
v0.15.7
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ee6db4668 | |||
| 76bad88190 | |||
| a4029725f9 | |||
| aed3d92462 | |||
| 76531f397f |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.idea
|
.idea
|
||||||
|
bolt.db
|
||||||
###> symfony/framework-bundle ###
|
###> symfony/framework-bundle ###
|
||||||
/.env.local
|
/.env.local
|
||||||
/.env.local.php
|
/.env.local.php
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ RUN install-php-extensions \
|
|||||||
opcache
|
opcache
|
||||||
|
|
||||||
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD [ "php", "/app/bin/console", "startup:status" ]
|
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD [ "php", "/app/bin/console", "startup:status" ]
|
||||||
|
|
||||||
|
COPY docker/app/Caddyfile /etc/frankenphp/Caddyfile
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
FROM registry.caldwell.digital/library/php:8.4-apache
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install libldap2-dev -y && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
|
|
||||||
docker-php-ext-install ldap
|
|
||||||
|
|
||||||
COPY --chown=www-data:www-data . /var/www
|
|
||||||
COPY bash/nginx.conf /etc/apache2/sites-enabled/vhost.conf
|
|
||||||
RUN rm /etc/apache2/sites-enabled/000-default.conf
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# $1 = movies/tvshows/etc, $2 = title of media, $3 = URL of download
|
|
||||||
cd /var/download/${1} && if [ ! -d "${2}" ]; then mkdir "${2}"; fi && cd "${2}" && wget "${3}"
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
root /var/www/public;
|
|
||||||
|
|
||||||
location /hub/ {
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_redirect off;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_pass http://mercure/;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
location / {
|
|
||||||
# try to serve file directly, fallback to index.php
|
|
||||||
try_files $uri /index.php$is_args$args;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
|
||||||
fastcgi_pass unix:/run/php-fpm.sock;
|
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
|
||||||
fastcgi_buffers 16 16k;
|
|
||||||
fastcgi_buffer_size 32k;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
|
||||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
|
||||||
internal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
38
compose.yml
38
compose.yml
@@ -12,18 +12,23 @@ services:
|
|||||||
- $PWD/bash/caddy:/etc/caddy
|
- $PWD/bash/caddy:/etc/caddy
|
||||||
- $PWD/bash/certs:/etc/ssl
|
- $PWD/bash/certs:/etc/ssl
|
||||||
|
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
|
||||||
FRANKENPHP_CONFIG: "worker /app/public/index.php"
|
|
||||||
volumes:
|
volumes:
|
||||||
- $PWD:/app
|
- $PWD:/app
|
||||||
|
- mercure_data:/data
|
||||||
|
- mercure_config:/config
|
||||||
tty: true
|
tty: true
|
||||||
|
environment:
|
||||||
|
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
|
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
depends_on:
|
depends_on:
|
||||||
database:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -32,6 +37,16 @@ services:
|
|||||||
tty: true
|
tty: true
|
||||||
command: php /app/bin/console messenger:consume async -vv
|
command: php /app/bin/console messenger:consume async -vv
|
||||||
|
|
||||||
|
|
||||||
|
scheduler:
|
||||||
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- $PWD:/app
|
||||||
|
command: php /app/bin/console messenger:consume scheduler_monitor -vv
|
||||||
|
tty: true
|
||||||
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
volumes:
|
volumes:
|
||||||
@@ -39,23 +54,6 @@ services:
|
|||||||
command: redis-server --maxmemory 512MB
|
command: redis-server --maxmemory 512MB
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
mercure:
|
|
||||||
image: dunglas/mercure
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "3000:80"
|
|
||||||
environment:
|
|
||||||
SERVER_NAME: ':80'
|
|
||||||
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
|
||||||
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
|
||||||
MERCURE_EXTRA_DIRECTIVES: |
|
|
||||||
cors_origins *
|
|
||||||
anonymous
|
|
||||||
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
|
|
||||||
volumes:
|
|
||||||
- mercure_data:/data
|
|
||||||
- mercure_config:/config
|
|
||||||
|
|
||||||
|
|
||||||
database:
|
database:
|
||||||
image: mariadb:10.11.2
|
image: mariadb:10.11.2
|
||||||
@@ -74,11 +72,13 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
|
|
||||||
adminer:
|
adminer:
|
||||||
image: adminer
|
image: adminer
|
||||||
ports:
|
ports:
|
||||||
- "8081:8080"
|
- "8081:8080"
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql:
|
mysql:
|
||||||
mercure_data:
|
mercure_data:
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ parameters:
|
|||||||
media.tvshows_path: '/var/download/%env(default:media.default_tvshows_dir:TVSHOWS_PATH)%'
|
media.tvshows_path: '/var/download/%env(default:media.default_tvshows_dir:TVSHOWS_PATH)%'
|
||||||
|
|
||||||
# Mercure
|
# Mercure
|
||||||
app.mercure.url: 'http://mercure/.well-known/mercure'
|
app.mercure.url: 'http://app/.well-known/mercure'
|
||||||
app.mercure.public_url: '%env(APP_URL)%/hub/.well-known/mercure'
|
app.mercure.public_url: '%env(APP_URL)%/.well-known/mercure'
|
||||||
|
|
||||||
# Cache
|
# Cache
|
||||||
app.cache.adapter: '%env(default:app.cache.adapter.default:CACHE_ADAPTER)%'
|
app.cache.adapter: '%env(default:app.cache.adapter.default:CACHE_ADAPTER)%'
|
||||||
|
|||||||
@@ -1,70 +1,45 @@
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: registry.caldwell.digital/home/torsearch-app:latest
|
image: registry.caldwell.digital/home/torsearch-app:${TAG}
|
||||||
ports:
|
ports:
|
||||||
- '8001:80'
|
- '8001:80'
|
||||||
|
environment:
|
||||||
|
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
|
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
deploy:
|
deploy:
|
||||||
replicas: 2
|
replicas: 2
|
||||||
|
volumes:
|
||||||
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
|
- mercure_data:/data
|
||||||
|
- mercure_config:/config
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: registry.caldwell.digital/home/torsearch-worker:latest
|
image: registry.caldwell.digital/home/torsearch-worker:${TAG}
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/media/downloads/movies:/var/download/movies
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
restart: always
|
restart: always
|
||||||
command: -vv
|
command: -vv
|
||||||
deploy:
|
deploy:
|
||||||
replicas: 4
|
replicas: 2
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
|
|
||||||
|
|
||||||
scheduler:
|
scheduler:
|
||||||
image: registry.caldwell.digital/home/torsearch-scheduler:latest
|
image: registry.caldwell.digital/home/torsearch-scheduler:${TAG}
|
||||||
volumes:
|
volumes:
|
||||||
- ./downloads:/var/download
|
- ./downloads:/var/download
|
||||||
restart: always
|
restart: always
|
||||||
|
command: -vv
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
|
|
||||||
|
|
||||||
mercure:
|
|
||||||
image: dunglas/mercure
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "3001:80"
|
|
||||||
environment:
|
|
||||||
SERVER_NAME: ':80'
|
|
||||||
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
|
||||||
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
|
||||||
MERCURE_EXTRA_DIRECTIVES: |
|
|
||||||
cors_origins *
|
|
||||||
anonymous
|
|
||||||
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
|
|
||||||
volumes:
|
|
||||||
- mercure_data:/data
|
|
||||||
- mercure_config:/config
|
|
||||||
|
|
||||||
|
|
||||||
database:
|
|
||||||
image: mariadb:10.11.2
|
|
||||||
volumes:
|
|
||||||
- mysql:/var/lib/mysql
|
|
||||||
environment:
|
|
||||||
MYSQL_DATABASE: app
|
|
||||||
MYSQL_USERNAME: app
|
|
||||||
MYSQL_PASSWORD: password
|
|
||||||
MYSQL_ROOT_PASSWORD: password
|
|
||||||
healthcheck:
|
|
||||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:latest
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
FROM dunglas/frankenphp
|
FROM dunglas/frankenphp
|
||||||
|
|
||||||
ENV FRANKENPHP_CONFIG="worker /app/public/index.php 20"
|
|
||||||
ENV SERVER_NAME=":80"
|
ENV SERVER_NAME=":80"
|
||||||
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
||||||
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
|
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
|
||||||
@@ -13,7 +12,8 @@ RUN install-php-extensions \
|
|||||||
opcache
|
opcache
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
COPY --chmod=775 ./bash/entrypoint.sh /usr/local/bin/docker-entrypoint
|
COPY --chmod=775 docker/app/entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||||
|
COPY docker/app/Caddyfile /etc/frankenphp/Caddyfile
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
|
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM dunglas/frankenphp
|
FROM dunglas/frankenphp:php8.4-alpine
|
||||||
|
|
||||||
ENV SERVER_NAME=":80"
|
ENV SERVER_NAME=":80"
|
||||||
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
||||||
@@ -13,4 +13,6 @@ RUN install-php-extensions \
|
|||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "schedule_monitor" ]
|
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "scheduler_monitor" ]
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD return 0
|
||||||
|
|||||||
66
docker/app/Caddyfile
Normal file
66
docker/app/Caddyfile
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
{$CADDY_GLOBAL_OPTIONS}
|
||||||
|
|
||||||
|
frankenphp {
|
||||||
|
{$FRANKENPHP_CONFIG}
|
||||||
|
|
||||||
|
worker {
|
||||||
|
file ./public/index.php
|
||||||
|
num 20
|
||||||
|
env APP_RUNTIME Runtime\FrankenPhpSymfony\Runtime
|
||||||
|
{$FRANKENPHP_WORKER_CONFIG}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{$CADDY_EXTRA_CONFIG}
|
||||||
|
|
||||||
|
{$SERVER_NAME:localhost} {
|
||||||
|
log {
|
||||||
|
{$CADDY_SERVER_LOG_OPTIONS}
|
||||||
|
# Redact the authorization query parameter that can be set by Mercure
|
||||||
|
format filter {
|
||||||
|
request>uri query {
|
||||||
|
replace authorization REDACTED
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
root /app/public
|
||||||
|
encode zstd br gzip
|
||||||
|
|
||||||
|
mercure {
|
||||||
|
# Publisher JWT key
|
||||||
|
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
|
||||||
|
# Subscriber JWT key
|
||||||
|
subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
|
||||||
|
# Allow anonymous subscribers (double-check that it's what you want)
|
||||||
|
anonymous
|
||||||
|
# Enable the subscription API (double-check that it's what you want)
|
||||||
|
subscriptions
|
||||||
|
# Custmo cors
|
||||||
|
cors_origins *
|
||||||
|
# Extra directives
|
||||||
|
{$MERCURE_EXTRA_DIRECTIVES}
|
||||||
|
}
|
||||||
|
|
||||||
|
vulcain
|
||||||
|
|
||||||
|
{$CADDY_SERVER_EXTRA_DIRECTIVES}
|
||||||
|
|
||||||
|
# Disable Topics tracking if not enabled explicitly: https://github.com/jkarlin/topics
|
||||||
|
header ?Permissions-Policy "browsing-topics=()"
|
||||||
|
|
||||||
|
@phpRoute {
|
||||||
|
not path /.well-known/mercure*
|
||||||
|
not file {path}
|
||||||
|
}
|
||||||
|
rewrite @phpRoute index.php
|
||||||
|
|
||||||
|
@frontController path index.php
|
||||||
|
php @frontController
|
||||||
|
|
||||||
|
file_server {
|
||||||
|
hide *.php
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
[program:messenger-consume]
|
|
||||||
command=php /var/www/bin/console messenger:consume async --time-limit=3600
|
|
||||||
user=nobody
|
|
||||||
numprocs=2
|
|
||||||
startsecs=0
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
startretries=10
|
|
||||||
process_name=%(program_name)s_%(process_num)02d
|
|
||||||
Reference in New Issue
Block a user