From cd2c128901f09a671810d8bf1519bb703c50604a Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Tue, 23 Jul 2024 00:25:56 +0300 Subject: [PATCH 1/2] castopod. stack draft. (#112) --- README.md | 1 + castopod/.env.dist | 44 ++++++++++++++++++++++++++++++++ castopod/docker-compose.yml | 46 ++++++++++++++++++++++++++++++++++ castopod/media/.gitignore | 2 ++ castopod/redis_data/.gitignore | 2 ++ 5 files changed, 95 insertions(+) create mode 100644 castopod/.env.dist create mode 100644 castopod/docker-compose.yml create mode 100644 castopod/media/.gitignore create mode 100644 castopod/redis_data/.gitignore diff --git a/README.md b/README.md index 0b428e6..acad4de 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Not every stack is tested to fully work. | App Name | Status | Image | Description | Links | |-------------------------|-------------|----------------------------------------------|-------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ARK Server | ✅ | `thmhoag/arkserver` | ARK: Survival Evolved game server with ArkManager. | [Website](http://playark.com), [Steam](https://store.steampowered.com/app/346110/ARK_Survival_Evolved/), [Image Github](https://github.com/thmhoag/arkserver), [ArkManager](https://github.com/arkmanager/ark-server-tools) | +| Castopod | ✅ | `castopod/castopod` | Self-hosted federated podcasting platform | [Website](https://castopod.org), [Gitlab](https://code.castopod.org/adaures/castopod) | | Drone | ✅ | `drone/drone` | Continuous integration platform. | [Website](https://www.drone.io), [Github](https://github.com/harness/drone), [Image](https://hub.docker.com/r/drone/drone) | | Drone Docker Runner | ✅ | `drone/drone-runner-docker` | CI runner daemon for Docker. | [Website](https://www.drone.io), [Github](https://github.com/drone-runners/drone-runner-docker), [Image](https://hub.docker.com/r/drone/drone-runner-docker) | | Duplicati | ✅ | `linuxserver/duplicati` | Backup solution with many storage backends. | [Website](https://www.duplicati.com), [Github](https://github.com/duplicati/duplicati) | diff --git a/castopod/.env.dist b/castopod/.env.dist new file mode 100644 index 0000000..2c61a18 --- /dev/null +++ b/castopod/.env.dist @@ -0,0 +1,44 @@ +# see https://docs.castopod.org/main/en/getting-started/docker/ +# see https://hub.docker.com/r/castopod/castopod + +# Ports +EXTERNAL_ADDRESS=127.0.0.1 +EXTERNAL_PORT=8393 + +# Castopod Settings + +CP_BASEURL=https://cp.domain.tld +CP_ANALYTICS_SALT=changeme +CP_CACHE_HANDLER=redis +#CP_REDIS_HOST=redis +CP_REDIS_PASSWORD=changeme + +# Storage + +MEDIA_PATH=./media +REDIS_DATA_PATH=./redis_data + +# See https://docs.castopod.org/main/en/getting-started/install/#s3 +#media.fileManager="s3" +#media.s3.endpoint="your_s3_host" +#media.s3.key="your_s3_key" +#media.s3.secret="your_s3_secret" +#media.s3.region="your_s3_region" +##media.s3.bucket="your_s3_bucket" + +# Mailing +#email.fromEmail=your_email_address +#email.SMTPHost=your_smtp_host +#email.SMTPUser=your_smtp_user +#email.SMTPPass=your_smtp_password +##email.SMTPPort=12345 +##email.SMTPCrypto=tls + +# Database + +MYSQL_DATABASE=database +MYSQL_USER=user +MYSQL_PASSWORD=password + +LOG_MAX_SIZE=5m +LOG_MAX_FILE=5 diff --git a/castopod/docker-compose.yml b/castopod/docker-compose.yml new file mode 100644 index 0000000..c4eed20 --- /dev/null +++ b/castopod/docker-compose.yml @@ -0,0 +1,46 @@ +services: + castopod: + image: castopod/castopod:latest + container_name: 'castopod' + volumes: + - '${MEDIA_PATH:-./media}:/var/www/castopod/public/media' + environment: + MYSQL_DATABASE: '${MYSQL_DATABASE:-host.docker.internal}' + MYSQL_USER: '${MYSQL_USER:-castopod}' + MYSQL_PASSWORD: '${MYSQL_PASSWORD}' + CP_BASEURL: "https://castopod.example.com" + CP_ANALYTICS_SALT: '${CP_ANALYTICS_SALT}' + CP_CACHE_HANDLER: redis + CP_REDIS_HOST: '${CP_REDIS_HOST:-redis}' + CP_REDIS_PASSWORD: '${CP_REDIS_PASSWORD}' + env_file: '.env' + networks: + - castopod + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - '${EXTERNAL_ADDRESS:-127.0.0.1}:${EXTERNAL_PORT:-8393}:8000' + restart: unless-stopped + logging: + driver: "json-file" + options: + max-size: "${LOG_MAX_SIZE:-5m}" + max-file: "${LOG_MAX_FILE:-5}" + + redis: + image: redis:7.2-alpine + container_name: "castopod-redis" + command: '--requirepass ${CP_REDIS_PASSWORD}' + volumes: + - '${REDIS_DATA_PATH:-./redis_data}:/data' + networks: + - castopod + restart: unless-stopped + logging: + driver: "json-file" + options: + max-size: "${LOG_MAX_SIZE:-5m}" + max-file: "${LOG_MAX_FILE:-5}" + +networks: + castopod: diff --git a/castopod/media/.gitignore b/castopod/media/.gitignore new file mode 100644 index 0000000..a68d087 --- /dev/null +++ b/castopod/media/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore diff --git a/castopod/redis_data/.gitignore b/castopod/redis_data/.gitignore new file mode 100644 index 0000000..a68d087 --- /dev/null +++ b/castopod/redis_data/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore -- 2.43.5 From ec2d07cc3545e88907b9723b08dd323ff513a811 Mon Sep 17 00:00:00 2001 From: Alexey Skobkin Date: Thu, 25 Jul 2024 23:00:14 +0300 Subject: [PATCH 2/2] castopod. refactoring configuration. --- castopod/.env.dist | 51 +++++++++++++++++++++++-------------- castopod/docker-compose.yml | 30 +++++++++++----------- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/castopod/.env.dist b/castopod/.env.dist index 2c61a18..ad5217d 100644 --- a/castopod/.env.dist +++ b/castopod/.env.dist @@ -1,5 +1,8 @@ # see https://docs.castopod.org/main/en/getting-started/docker/ # see https://hub.docker.com/r/castopod/castopod +# see https://docs.castopod.org/main/en/getting-started/docker/#environment-variables + +IMAGE_TAG=latest # Ports EXTERNAL_ADDRESS=127.0.0.1 @@ -8,37 +11,47 @@ EXTERNAL_PORT=8393 # Castopod Settings CP_BASEURL=https://cp.domain.tld +#CP_MEDIA_BASEURL=https://cp.domain.tld CP_ANALYTICS_SALT=changeme -CP_CACHE_HANDLER=redis +#CP_CACHE_HANDLER=redis #CP_REDIS_HOST=redis CP_REDIS_PASSWORD=changeme +#CP_ADMIN_GATEWAY=custom-admin-path +#CP_AUTH_GATEWAY=custom-auth-path + +#CP_ENABLE_2FA=true + +CP_DATABASE_HOSTNAME=host.docker.internal +CP_DATABASE_NAME=castopod +CP_DATABASE_USERNAME=castopod +CP_DATABASE_PASSWORD=changeme + # Storage MEDIA_PATH=./media REDIS_DATA_PATH=./redis_data # See https://docs.castopod.org/main/en/getting-started/install/#s3 -#media.fileManager="s3" -#media.s3.endpoint="your_s3_host" -#media.s3.key="your_s3_key" -#media.s3.secret="your_s3_secret" -#media.s3.region="your_s3_region" -##media.s3.bucket="your_s3_bucket" +#CP_MEDIA_FILE_MANAGER="s3" +#CP_MEDIA_S3_ENDPOINT="your_s3_host" +#CP_MEDIA_S3_KEY="your_s3_key" +#CP_MEDIA_S3_SECRET="your_s3_secret" +#CP_MEDIA_S3_REGION="your_s3_region" +##CP_MEDIA_S3_BUCKET="your_s3_bucket" +##CP_MEDIA_S3_PROTOCOL= +##CP_MEDIA_S3_PATH_STYLE_ENDPOINT= +##CP_MEDIA_S3_KEY_PREFIX= + +#CP_MAX_BODY_SIZE=512M # Mailing -#email.fromEmail=your_email_address -#email.SMTPHost=your_smtp_host -#email.SMTPUser=your_smtp_user -#email.SMTPPass=your_smtp_password -##email.SMTPPort=12345 -##email.SMTPCrypto=tls - -# Database - -MYSQL_DATABASE=database -MYSQL_USER=user -MYSQL_PASSWORD=password +#CP_EMAIL_FROM=your_email_address +#CP_EMAIL_SMTP_HOST=your_smtp_host +#CP_EMAIL_SMTP_USERNAME=your_smtp_user +#CP_EMAIL_SMTP_PASSWORD=your_smtp_password +##CP_EMAIL_SMTP_PORT=12345 +##CP_EMAIL_SMTP_CRYPTO=tls LOG_MAX_SIZE=5m LOG_MAX_FILE=5 diff --git a/castopod/docker-compose.yml b/castopod/docker-compose.yml index c4eed20..1582ea0 100644 --- a/castopod/docker-compose.yml +++ b/castopod/docker-compose.yml @@ -1,35 +1,35 @@ services: castopod: - image: castopod/castopod:latest + image: 'castopod/castopod:${IMAGE_TAG:-latest}' container_name: 'castopod' volumes: - '${MEDIA_PATH:-./media}:/var/www/castopod/public/media' environment: - MYSQL_DATABASE: '${MYSQL_DATABASE:-host.docker.internal}' - MYSQL_USER: '${MYSQL_USER:-castopod}' - MYSQL_PASSWORD: '${MYSQL_PASSWORD}' - CP_BASEURL: "https://castopod.example.com" + MYSQL_DATABASE: '${CP_DATABASE_NAME:-castopod}' + MYSQL_USER: '${CP_DATABASE_USERNAME:-castopod}' + MYSQL_PASSWORD: '${CP_DATABASE_PASSWORD}' + CP_BASEURL: "${CP_BASEURL}" CP_ANALYTICS_SALT: '${CP_ANALYTICS_SALT}' - CP_CACHE_HANDLER: redis + CP_CACHE_HANDLER: '${CP_CACHE_HANDLER:-redis}' CP_REDIS_HOST: '${CP_REDIS_HOST:-redis}' CP_REDIS_PASSWORD: '${CP_REDIS_PASSWORD}' env_file: '.env' networks: - castopod extra_hosts: - - "host.docker.internal:host-gateway" + - 'host.docker.internal:host-gateway' ports: - '${EXTERNAL_ADDRESS:-127.0.0.1}:${EXTERNAL_PORT:-8393}:8000' restart: unless-stopped logging: - driver: "json-file" + driver: 'json-file' options: - max-size: "${LOG_MAX_SIZE:-5m}" - max-file: "${LOG_MAX_FILE:-5}" + max-size: '${LOG_MAX_SIZE:-5m}' + max-file: '${LOG_MAX_FILE:-5}' redis: - image: redis:7.2-alpine - container_name: "castopod-redis" + image: 'redis:7.2-alpine' + container_name: 'castopod-redis' command: '--requirepass ${CP_REDIS_PASSWORD}' volumes: - '${REDIS_DATA_PATH:-./redis_data}:/data' @@ -37,10 +37,10 @@ services: - castopod restart: unless-stopped logging: - driver: "json-file" + driver: 'json-file' options: - max-size: "${LOG_MAX_SIZE:-5m}" - max-file: "${LOG_MAX_FILE:-5}" + max-size: '${LOG_MAX_SIZE:-5m}' + max-file: '${LOG_MAX_FILE:-5}' networks: castopod: -- 2.43.5