Compare commits
17 Commits
dev-stream
...
v0.15.12
| Author | SHA1 | Date | |
|---|---|---|---|
| 3100912927 | |||
| 07553a172f | |||
| a88da4f637 | |||
| a88f128ccb | |||
| b1ec344f42 | |||
| 1ee6db4668 | |||
| 76bad88190 | |||
| a4029725f9 | |||
| aed3d92462 | |||
| 76531f397f | |||
| c763d67fcb | |||
| e85ae5ac95 | |||
| 794189d70a | |||
| 34d9029b7c | |||
| 168bf04550 | |||
| 81eb2d1f62 | |||
| f5102b859f |
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
|
||||||
|
|||||||
27
Dockerfile
27
Dockerfile
@@ -1,19 +1,16 @@
|
|||||||
FROM php:8.4-fpm-alpine3.21
|
FROM dunglas/frankenphp
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo_mysql
|
ENV SERVER_NAME=":80"
|
||||||
|
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
||||||
|
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
|
||||||
|
|
||||||
# SETUP PHP-FPM CONFIG SETTINGS (max_children / max_requests)
|
RUN install-php-extensions \
|
||||||
RUN echo 'pm = dynamic' >> /usr/local/etc/php-fpm.d/zz-docker.conf && \
|
pdo_mysql \
|
||||||
echo 'pm.max_children = 75' >> /usr/local/etc/php-fpm.d/zz-docker.conf && \
|
gd \
|
||||||
echo 'pm.start_servers = 30' >> /usr/local/etc/php-fpm.d/zz-docker.conf && \
|
intl \
|
||||||
echo 'pm.min_spare_servers = 5' >> /usr/local/etc/php-fpm.d/zz-docker.conf && \
|
zip \
|
||||||
echo 'pm.max_spare_servers = 30' >> /usr/local/etc/php-fpm.d/zz-docker.conf && \
|
opcache
|
||||||
echo 'pm.process_idle_timeout = 10s' >> /usr/local/etc/php-fpm.d/zz-docker.conf
|
|
||||||
|
|
||||||
COPY --chmod=0775 ./bash/entrypoint.sh /usr/local/bin/
|
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD [ "php", "/app/bin/console", "startup:status" ]
|
||||||
|
|
||||||
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD [ "php", "/var/www/bin/console", "startup:status" ]
|
COPY docker/app/Caddyfile /etc/frankenphp/Caddyfile
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
|
||||||
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
|||||||
@@ -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,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Sleep for a second to ensure DB is awake and ready
|
|
||||||
SLEEP_TIME=$(shuf -i 2-5 -n 1)
|
|
||||||
echo "> Sleeping for ${SLEEP_TIME} seconds to wait for the database"
|
|
||||||
echo "> If there are errors after the migration runs, it's possible another container (scheduler, worker, etc.) already ran the migrations"
|
|
||||||
sleep $SLEEP_TIME
|
|
||||||
|
|
||||||
# Provision database
|
|
||||||
php /var/www/bin/console doctrine:migrations:migrate --no-interaction
|
|
||||||
php /var/www/bin/console db:seed
|
|
||||||
|
|
||||||
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
96
compose.yml
96
compose.yml
@@ -12,6 +12,41 @@ services:
|
|||||||
- $PWD/bash/caddy:/etc/caddy
|
- $PWD/bash/caddy:/etc/caddy
|
||||||
- $PWD/bash/certs:/etc/ssl
|
- $PWD/bash/certs:/etc/ssl
|
||||||
|
|
||||||
|
|
||||||
|
app:
|
||||||
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- $PWD:/app
|
||||||
|
- mercure_data:/data
|
||||||
|
- mercure_config:/config
|
||||||
|
tty: true
|
||||||
|
environment:
|
||||||
|
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
|
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
|
depends_on:
|
||||||
|
database:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
|
||||||
|
worker:
|
||||||
|
build: .
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- $PWD:/app
|
||||||
|
tty: true
|
||||||
|
command: php /app/bin/console messenger:consume async -vv --time-limit=3600 limit=10
|
||||||
|
|
||||||
|
|
||||||
|
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:
|
||||||
@@ -19,62 +54,6 @@ services:
|
|||||||
command: redis-server --maxmemory 512MB
|
command: redis-server --maxmemory 512MB
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
app:
|
|
||||||
build:
|
|
||||||
dockerfile: docker/Dockerfile.app
|
|
||||||
context: .
|
|
||||||
ports:
|
|
||||||
- "8001:80"
|
|
||||||
volumes:
|
|
||||||
- ./:/var/www
|
|
||||||
depends_on:
|
|
||||||
database:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
worker:
|
|
||||||
build:
|
|
||||||
dockerfile: docker/Dockerfile.worker
|
|
||||||
context: .
|
|
||||||
volumes:
|
|
||||||
- ./:/app
|
|
||||||
- ./var/downloads/movies:/var/download/movies
|
|
||||||
- ./var/downloads/tvshows:/var/download/tvshows
|
|
||||||
command: -vvv --time-limit=3600
|
|
||||||
env_file:
|
|
||||||
- .env
|
|
||||||
depends_on:
|
|
||||||
app:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
scheduler:
|
|
||||||
build:
|
|
||||||
dockerfile: docker/Dockerfile.scheduler
|
|
||||||
context: .
|
|
||||||
volumes:
|
|
||||||
- ./:/var/www
|
|
||||||
- ./var/download:/var/download
|
|
||||||
command: -vv --time-limit=3600
|
|
||||||
depends_on:
|
|
||||||
app:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
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
|
||||||
@@ -89,14 +68,17 @@ services:
|
|||||||
MYSQL_ROOT_PASSWORD: password
|
MYSQL_ROOT_PASSWORD: password
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||||
timeout: 10s
|
interval: 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:
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"p3k/emoji-detector": "^1.2",
|
"p3k/emoji-detector": "^1.2",
|
||||||
"php-tmdb/api": "^4.1",
|
"php-tmdb/api": "^4.1",
|
||||||
"predis/predis": "^2.4",
|
"predis/predis": "^2.4",
|
||||||
|
"runtime/frankenphp-symfony": "^0.2.0",
|
||||||
"symfony/asset": "7.2.*",
|
"symfony/asset": "7.2.*",
|
||||||
"symfony/console": "7.2.*",
|
"symfony/console": "7.2.*",
|
||||||
"symfony/doctrine-messenger": "7.2.*",
|
"symfony/doctrine-messenger": "7.2.*",
|
||||||
|
|||||||
54
composer.lock
generated
54
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "33f1579a34e7ada02bb4738a9b39f493",
|
"content-hash": "c4ad1f54b8dd44fb55097f631c945460",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "1tomany/rich-bundle",
|
"name": "1tomany/rich-bundle",
|
||||||
@@ -3300,6 +3300,58 @@
|
|||||||
},
|
},
|
||||||
"time": "2021-10-29T13:26:27+00:00"
|
"time": "2021-10-29T13:26:27+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "runtime/frankenphp-symfony",
|
||||||
|
"version": "0.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-runtime/frankenphp-symfony.git",
|
||||||
|
"reference": "56822c3631d9522a3136a4c33082d006bdfe4bad"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-runtime/frankenphp-symfony/zipball/56822c3631d9522a3136a4c33082d006bdfe4bad",
|
||||||
|
"reference": "56822c3631d9522a3136a4c33082d006bdfe4bad",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=8.1",
|
||||||
|
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
|
||||||
|
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0",
|
||||||
|
"symfony/runtime": "^5.4 || ^6.0 || ^7.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Runtime\\FrankenPhpSymfony\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Kévin Dunglas",
|
||||||
|
"email": "kevin@dunglas.dev"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "FrankenPHP runtime for Symfony",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/php-runtime/frankenphp-symfony/issues",
|
||||||
|
"source": "https://github.com/php-runtime/frankenphp-symfony/tree/0.2.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/nyholm",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-12-12T12:06:11+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/asset",
|
"name": "symfony/asset",
|
||||||
"version": "v7.2.0",
|
"version": "v7.2.0",
|
||||||
|
|||||||
@@ -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,50 +1,57 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
app:
|
||||||
image: code.caldwell.digital/home/torsearch/web:latest
|
image: registry.caldwell.digital/home/torsearch-app:${TAG}
|
||||||
ports:
|
ports:
|
||||||
- '8001:80'
|
- '8001:80'
|
||||||
volumes:
|
|
||||||
- $PWD/bash/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
depends_on:
|
|
||||||
app:
|
|
||||||
condition: service_healthy
|
|
||||||
|
|
||||||
app:
|
|
||||||
image: code.caldwell.digital/home/torsearch/app:${TAG}
|
|
||||||
deploy:
|
|
||||||
replicas: 2
|
|
||||||
|
|
||||||
worker:
|
|
||||||
image: code.caldwell.digital/home/torsearch/app:${TAG}
|
|
||||||
volumes:
|
|
||||||
- /mnt/media/downloads:/var/download
|
|
||||||
command: php ./bin/console messenger:consume async -v --time-limit=3600 --limit=10
|
|
||||||
deploy:
|
|
||||||
replicas: 2
|
|
||||||
|
|
||||||
scheduler:
|
|
||||||
image: code.caldwell.digital/home/torsearch/app:${TAG}
|
|
||||||
volumes:
|
|
||||||
- /mnt/media/downloads:/var/download
|
|
||||||
command: php ./bin/console messenger:consume scheduler_monitor -vv --time-limit=3600
|
|
||||||
|
|
||||||
mercure:
|
|
||||||
image: dunglas/mercure
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "3000:80"
|
|
||||||
environment:
|
environment:
|
||||||
SERVER_NAME: ':80'
|
|
||||||
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!'
|
||||||
MERCURE_EXTRA_DIRECTIVES: |
|
deploy:
|
||||||
cors_origins *
|
replicas: 2
|
||||||
anonymous
|
|
||||||
command: /usr/bin/caddy run --config /etc/caddy/dev.Caddyfile
|
|
||||||
volumes:
|
volumes:
|
||||||
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
- mercure_data:/data
|
- mercure_data:/data
|
||||||
- mercure_config:/config
|
- mercure_config:/config
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
|
||||||
|
|
||||||
|
worker:
|
||||||
|
image: registry.caldwell.digital/home/torsearch-worker:${TAG}
|
||||||
|
volumes:
|
||||||
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
|
restart: always
|
||||||
|
command: -vv --time-limit=3600 limit=10
|
||||||
|
deploy:
|
||||||
|
replicas: 2
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
|
||||||
|
|
||||||
|
scheduler:
|
||||||
|
image: registry.caldwell.digital/home/torsearch-scheduler:${TAG}
|
||||||
|
volumes:
|
||||||
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
|
restart: always
|
||||||
|
command: -vv
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:latest
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
command: redis-server --maxmemory 512MB
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
mysql:
|
||||||
mercure_config:
|
mercure_config:
|
||||||
mercure_data:
|
mercure_data:
|
||||||
|
redis_data:
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
FROM trafex/php-nginx:3.9.0
|
FROM dunglas/frankenphp
|
||||||
|
|
||||||
USER root
|
ENV SERVER_NAME=":80"
|
||||||
|
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
||||||
|
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN install-php-extensions \
|
||||||
php84-pdo_mysql \
|
pdo_mysql \
|
||||||
php84-simplexml
|
gd \
|
||||||
|
intl \
|
||||||
|
zip \
|
||||||
|
opcache
|
||||||
|
|
||||||
USER nobody
|
COPY . /app
|
||||||
|
COPY --chmod=775 docker/app/entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||||
|
COPY docker/app/Caddyfile /etc/frankenphp/Caddyfile
|
||||||
|
|
||||||
COPY --chown=nobody:nobody . /var/www
|
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint" ]
|
||||||
COPY --chmod=0775 ./bash/entrypoint.sh /usr/local/bin/
|
|
||||||
COPY --chmod=0755 ./bash/nginx.conf /etc/nginx/conf.d/site.conf
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD [ "php", "/var/www/bin/console", "startup:status" ]
|
CMD [ "frankenphp", "run", "--config", "/etc/frankenphp/Caddyfile" ]
|
||||||
|
|
||||||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
|
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD [ "php", "/app/bin/console", "startup:status" ]
|
||||||
|
|
||||||
WORKDIR /var/www
|
|
||||||
|
|||||||
@@ -1,7 +1,18 @@
|
|||||||
FROM php:8.4-cli-alpine3.21
|
FROM dunglas/frankenphp:php8.4-alpine
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo_mysql
|
ENV SERVER_NAME=":80"
|
||||||
|
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
||||||
|
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
|
||||||
|
|
||||||
COPY --chown=www-data:www-data . /app
|
RUN install-php-extensions \
|
||||||
|
pdo_mysql \
|
||||||
|
gd \
|
||||||
|
intl \
|
||||||
|
zip \
|
||||||
|
opcache
|
||||||
|
|
||||||
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "scheduler_monitor" ]
|
COPY . /app
|
||||||
|
|
||||||
|
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "scheduler_monitor" ]
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD return 0
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM nginx:1.28-alpine
|
|
||||||
|
|
||||||
COPY bash/nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
@@ -1,7 +1,18 @@
|
|||||||
FROM php:8.4-cli-alpine3.21
|
FROM dunglas/frankenphp:php8.4-alpine
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo_mysql
|
ENV SERVER_NAME=":80"
|
||||||
|
ENV CADDY_GLOBAL_OPTIONS="auto_https off"
|
||||||
|
ENV APP_RUNTIME="Runtime\\FrankenPhpSymfony\\Runtime"
|
||||||
|
|
||||||
COPY --chown=www-data:www-data . /app
|
RUN install-php-extensions \
|
||||||
|
pdo_mysql \
|
||||||
|
gd \
|
||||||
|
intl \
|
||||||
|
zip \
|
||||||
|
opcache
|
||||||
|
|
||||||
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "async" ]
|
COPY . /app
|
||||||
|
|
||||||
|
ENTRYPOINT [ "php", "/app/bin/console", "messenger:consume", "async" ]
|
||||||
|
|
||||||
|
HEALTHCHECK --interval=3s --timeout=3s --retries=10 CMD return 0
|
||||||
|
|||||||
61
docker/app/Caddyfile
Normal file
61
docker/app/Caddyfile
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
{$CADDY_GLOBAL_OPTIONS}
|
||||||
|
|
||||||
|
frankenphp {
|
||||||
|
{$FRANKENPHP_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
|
||||||
|
}
|
||||||
|
}
|
||||||
12
docker/app/entrypoint.sh
Normal file
12
docker/app/entrypoint.sh
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Sleep for a second to ensure DB is awake and ready
|
||||||
|
SLEEP_TIME=$(shuf -i 2-4 -n 1)
|
||||||
|
echo "> Sleeping for ${SLEEP_TIME} seconds to wait for the database"
|
||||||
|
sleep $SLEEP_TIME
|
||||||
|
|
||||||
|
# Provision database
|
||||||
|
php /app/bin/console doctrine:migrations:migrate --no-interaction
|
||||||
|
php /app/bin/console db:seed
|
||||||
|
|
||||||
|
exec docker-php-entrypoint "$@"
|
||||||
@@ -19,13 +19,17 @@ DATABASE_URL="mysql://root:password@database:3306/app?serverVersion=10.6.19.2-Ma
|
|||||||
# This key is never saved anywhere
|
# This key is never saved anywhere
|
||||||
# else and is passed to Torrentio
|
# else and is passed to Torrentio
|
||||||
# to retrieve download options
|
# to retrieve download options
|
||||||
REAL_DEBRID_KEY=""
|
#REAL_DEBRID_KEY=""
|
||||||
|
|
||||||
# Enter you TMDB API key
|
# Enter you TMDB API key
|
||||||
# This is used to provide rich search results
|
# This is used to provide rich search results
|
||||||
# when searching for media and rendering the
|
# when searching for media and rendering the
|
||||||
# Popular Movies and TV Shows section.
|
# Popular Movies and TV Shows section.
|
||||||
TMDB_API=
|
#TMDB_API=
|
||||||
|
|
||||||
|
REAL_DEBRID_KEY="QYYBR7OSQ4VEFKWASDEZ2B4VO67KHUJY6IWOT7HHA7ATXO7QCYDQ"
|
||||||
|
TMDB_API=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI0ZTJjYjJhOGUzOGJhNjdiNjVhOGU1NGM0ZWI1MzhmOCIsIm5iZiI6MTczNzkyNjA0NC41NjQsInN1YiI6IjY3OTZhNTljYzdiMDFiNzJjNzIzZWM5YiIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.e8DbNe9qrSBC1y-ANRv-VWBAtls-ZS2r7aNCiI68mpw
|
||||||
|
|
||||||
|
|
||||||
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!"
|
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!"
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ services:
|
|||||||
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
|
||||||
command: -v --time-limit=3600 --limit=10
|
command: -vvv
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
restart: always
|
restart: always
|
||||||
@@ -44,7 +44,6 @@ services:
|
|||||||
image: code.caldwell.digital/home/torsearch-scheduler:latest
|
image: code.caldwell.digital/home/torsearch-scheduler:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./downloads:/var/download
|
- ./downloads:/var/download
|
||||||
command: -vv --time-limit=3600
|
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
restart: always
|
restart: always
|
||||||
@@ -84,7 +83,8 @@ services:
|
|||||||
MYSQL_ROOT_PASSWORD: password
|
MYSQL_ROOT_PASSWORD: password
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
||||||
timeout: 10s
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
115
docs/examples/swarm.compose.yml
Normal file
115
docs/examples/swarm.compose.yml
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
services:
|
||||||
|
# The "entrypoint" into the application. This reverse proxy
|
||||||
|
# proxies traffic back to their respective services. If not
|
||||||
|
# running behind a reverse proxy inject your SSL certificates
|
||||||
|
# into this container.
|
||||||
|
# This container runs the actual web app in a php:8.4-fpm
|
||||||
|
# base container.
|
||||||
|
app:
|
||||||
|
image: code.caldwell.digital/home/torsearch-app:latest
|
||||||
|
ports:
|
||||||
|
- '8006:80'
|
||||||
|
configs:
|
||||||
|
- env_file
|
||||||
|
deploy:
|
||||||
|
replicas: 2
|
||||||
|
depends_on:
|
||||||
|
- database
|
||||||
|
|
||||||
|
# Downloads happen in this container. Replicate this
|
||||||
|
# container to run multiple downloads simultaneously.
|
||||||
|
# Map your "movies" folder to /var/download/movies
|
||||||
|
# Map your "TV shows" folder to /var/download/tvshows
|
||||||
|
# If your folders are on another machine, use an NFS volume.
|
||||||
|
# This container runs a Symfony worker process.
|
||||||
|
# See: https://symfony.com/doc/current/messenger.html
|
||||||
|
worker:
|
||||||
|
image: code.caldwell.digital/home/torsearch-worker:latest
|
||||||
|
configs:
|
||||||
|
- source: env_file
|
||||||
|
target: /app/bin/.env.local
|
||||||
|
volumes:
|
||||||
|
- /mnt/media/downloads/movies:/var/download/movies
|
||||||
|
- /mnt/media/downloads/tvshows:/var/download/tvshows
|
||||||
|
restart: always
|
||||||
|
command: -vv
|
||||||
|
deploy:
|
||||||
|
replicas: 4
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
|
||||||
|
# This container handles the monitoring for new media. When new
|
||||||
|
# monitors are added, jobs are periodically dispatched to this
|
||||||
|
# container, and the desired media is searched for and downloaded.
|
||||||
|
# This container runs a Symfony worker process.
|
||||||
|
# See: https://symfony.com/doc/current/messenger.html
|
||||||
|
scheduler:
|
||||||
|
image: code.caldwell.digital/home/torsearch-scheduler:latest
|
||||||
|
configs:
|
||||||
|
- env_file
|
||||||
|
volumes:
|
||||||
|
- ./downloads:/var/download
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
|
||||||
|
# This container facilitates viewing the progress of downloads
|
||||||
|
# in realtime. It also handles sending alerts and notifications.
|
||||||
|
# The MERCURE_PUBLISHER_JWT key & MERCURE_SUBSCRIBER_JWT_KEY should
|
||||||
|
# match the MERCURE_JWT_SECRET environment variable.
|
||||||
|
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:
|
||||||
|
image: redis:latest
|
||||||
|
volumes:
|
||||||
|
- redis_data:/data
|
||||||
|
command: redis-server --maxmemory 512MB
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
# **Optional**
|
||||||
|
# Provides a simple method of viewing the database
|
||||||
|
adminer:
|
||||||
|
image: adminer
|
||||||
|
ports:
|
||||||
|
- "8081:8080"
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mysql:
|
||||||
|
mercure_config:
|
||||||
|
mercure_data:
|
||||||
|
redis_data:
|
||||||
|
|
||||||
|
configs:
|
||||||
|
env_file:
|
||||||
|
file: $PWD/.env
|
||||||
|
|
||||||
@@ -56,4 +56,4 @@ class ApiController extends AbstractController
|
|||||||
|
|
||||||
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
|
return $this->json(['status' => 200, 'message' => 'Added to Queue']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
namespace App\User\Framework\Controller\Web;
|
namespace App\User\Framework\Controller\Web;
|
||||||
|
|
||||||
use App\User\Action\Handler\RegisterUserHandler;
|
|
||||||
use App\User\Framework\Repository\UserRepository;
|
use App\User\Framework\Repository\UserRepository;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|||||||
Reference in New Issue
Block a user