castopod. refactoring configuration.

This commit is contained in:
Alexey Skobkin 2024-07-25 23:00:14 +03:00
parent cd2c128901
commit ec2d07cc35
Signed by: skobkin
GPG key ID: 4389E670595BF8A8
2 changed files with 47 additions and 34 deletions

View file

@ -1,5 +1,8 @@
# see https://docs.castopod.org/main/en/getting-started/docker/ # see https://docs.castopod.org/main/en/getting-started/docker/
# see https://hub.docker.com/r/castopod/castopod # see https://hub.docker.com/r/castopod/castopod
# see https://docs.castopod.org/main/en/getting-started/docker/#environment-variables
IMAGE_TAG=latest
# Ports # Ports
EXTERNAL_ADDRESS=127.0.0.1 EXTERNAL_ADDRESS=127.0.0.1
@ -8,37 +11,47 @@ EXTERNAL_PORT=8393
# Castopod Settings # Castopod Settings
CP_BASEURL=https://cp.domain.tld CP_BASEURL=https://cp.domain.tld
#CP_MEDIA_BASEURL=https://cp.domain.tld
CP_ANALYTICS_SALT=changeme CP_ANALYTICS_SALT=changeme
CP_CACHE_HANDLER=redis #CP_CACHE_HANDLER=redis
#CP_REDIS_HOST=redis #CP_REDIS_HOST=redis
CP_REDIS_PASSWORD=changeme 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 # Storage
MEDIA_PATH=./media MEDIA_PATH=./media
REDIS_DATA_PATH=./redis_data REDIS_DATA_PATH=./redis_data
# See https://docs.castopod.org/main/en/getting-started/install/#s3 # See https://docs.castopod.org/main/en/getting-started/install/#s3
#media.fileManager="s3" #CP_MEDIA_FILE_MANAGER="s3"
#media.s3.endpoint="your_s3_host" #CP_MEDIA_S3_ENDPOINT="your_s3_host"
#media.s3.key="your_s3_key" #CP_MEDIA_S3_KEY="your_s3_key"
#media.s3.secret="your_s3_secret" #CP_MEDIA_S3_SECRET="your_s3_secret"
#media.s3.region="your_s3_region" #CP_MEDIA_S3_REGION="your_s3_region"
##media.s3.bucket="your_s3_bucket" ##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 # Mailing
#email.fromEmail=your_email_address #CP_EMAIL_FROM=your_email_address
#email.SMTPHost=your_smtp_host #CP_EMAIL_SMTP_HOST=your_smtp_host
#email.SMTPUser=your_smtp_user #CP_EMAIL_SMTP_USERNAME=your_smtp_user
#email.SMTPPass=your_smtp_password #CP_EMAIL_SMTP_PASSWORD=your_smtp_password
##email.SMTPPort=12345 ##CP_EMAIL_SMTP_PORT=12345
##email.SMTPCrypto=tls ##CP_EMAIL_SMTP_CRYPTO=tls
# Database
MYSQL_DATABASE=database
MYSQL_USER=user
MYSQL_PASSWORD=password
LOG_MAX_SIZE=5m LOG_MAX_SIZE=5m
LOG_MAX_FILE=5 LOG_MAX_FILE=5

View file

@ -1,35 +1,35 @@
services: services:
castopod: castopod:
image: castopod/castopod:latest image: 'castopod/castopod:${IMAGE_TAG:-latest}'
container_name: 'castopod' container_name: 'castopod'
volumes: volumes:
- '${MEDIA_PATH:-./media}:/var/www/castopod/public/media' - '${MEDIA_PATH:-./media}:/var/www/castopod/public/media'
environment: environment:
MYSQL_DATABASE: '${MYSQL_DATABASE:-host.docker.internal}' MYSQL_DATABASE: '${CP_DATABASE_NAME:-castopod}'
MYSQL_USER: '${MYSQL_USER:-castopod}' MYSQL_USER: '${CP_DATABASE_USERNAME:-castopod}'
MYSQL_PASSWORD: '${MYSQL_PASSWORD}' MYSQL_PASSWORD: '${CP_DATABASE_PASSWORD}'
CP_BASEURL: "https://castopod.example.com" CP_BASEURL: "${CP_BASEURL}"
CP_ANALYTICS_SALT: '${CP_ANALYTICS_SALT}' 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_HOST: '${CP_REDIS_HOST:-redis}'
CP_REDIS_PASSWORD: '${CP_REDIS_PASSWORD}' CP_REDIS_PASSWORD: '${CP_REDIS_PASSWORD}'
env_file: '.env' env_file: '.env'
networks: networks:
- castopod - castopod
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - 'host.docker.internal:host-gateway'
ports: ports:
- '${EXTERNAL_ADDRESS:-127.0.0.1}:${EXTERNAL_PORT:-8393}:8000' - '${EXTERNAL_ADDRESS:-127.0.0.1}:${EXTERNAL_PORT:-8393}:8000'
restart: unless-stopped restart: unless-stopped
logging: logging:
driver: "json-file" driver: 'json-file'
options: options:
max-size: "${LOG_MAX_SIZE:-5m}" max-size: '${LOG_MAX_SIZE:-5m}'
max-file: "${LOG_MAX_FILE:-5}" max-file: '${LOG_MAX_FILE:-5}'
redis: redis:
image: redis:7.2-alpine image: 'redis:7.2-alpine'
container_name: "castopod-redis" container_name: 'castopod-redis'
command: '--requirepass ${CP_REDIS_PASSWORD}' command: '--requirepass ${CP_REDIS_PASSWORD}'
volumes: volumes:
- '${REDIS_DATA_PATH:-./redis_data}:/data' - '${REDIS_DATA_PATH:-./redis_data}:/data'
@ -37,10 +37,10 @@ services:
- castopod - castopod
restart: unless-stopped restart: unless-stopped
logging: logging:
driver: "json-file" driver: 'json-file'
options: options:
max-size: "${LOG_MAX_SIZE:-5m}" max-size: '${LOG_MAX_SIZE:-5m}'
max-file: "${LOG_MAX_FILE:-5}" max-file: '${LOG_MAX_FILE:-5}'
networks: networks:
castopod: castopod: