Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
977984baf5 | ||
|
05680cd235 | ||
|
9d20909ae4 | ||
|
544783955a | ||
|
a97746b191 | ||
|
9dde935a1d | ||
|
45e563b875 |
31
.env.sample
31
.env.sample
@ -12,20 +12,9 @@ SECRET_DJANGO_SECRET_KEY_VERSION=v1
|
|||||||
# more concurrent requests, but also leads to higher CPU/Memory usage
|
# more concurrent requests, but also leads to higher CPU/Memory usage
|
||||||
FUNKWHALE_WEB_WORKERS=4
|
FUNKWHALE_WEB_WORKERS=4
|
||||||
|
|
||||||
# Replace this by the definitive, public domain you will use for
|
|
||||||
# your instance. It cannot be changed after initial deployment
|
|
||||||
# without breaking your instance.
|
|
||||||
FUNKWHALE_HOSTNAME=funkwhale.example.com
|
|
||||||
FUNKWHALE_PROTOCOL=https
|
|
||||||
|
|
||||||
# Log level (debug, info, warning, error, critical)
|
# Log level (debug, info, warning, error, critical)
|
||||||
LOGLEVEL=error
|
LOGLEVEL=error
|
||||||
|
|
||||||
# Depending on the reverse proxy used in front of your funkwhale instance,
|
|
||||||
# the API will use different kind of headers to serve audio files
|
|
||||||
# Allowed values: nginx, apache2
|
|
||||||
REVERSE_PROXY_TYPE=nginx
|
|
||||||
|
|
||||||
# Number of worker processes to execute. Defaults to 0, in which case it uses
|
# Number of worker processes to execute. Defaults to 0, in which case it uses
|
||||||
# your number of CPUs Celery workers handle background tasks (such file imports
|
# your number of CPUs Celery workers handle background tasks (such file imports
|
||||||
# or federation messaging). The more processes a worker gets, the more tasks
|
# or federation messaging). The more processes a worker gets, the more tasks
|
||||||
@ -33,6 +22,20 @@ REVERSE_PROXY_TYPE=nginx
|
|||||||
# memory footprint.
|
# memory footprint.
|
||||||
# CELERYD_CONCURRENCY=0
|
# CELERYD_CONCURRENCY=0
|
||||||
|
|
||||||
# which settings module should django use?
|
# Max upload size
|
||||||
# You don't have to touch this unless you really know what you're doing
|
NGINX_MAX_BODY_SIZE=100M
|
||||||
DJANGO_SETTINGS_MODULE=config.settings.production
|
|
||||||
|
# Insert e-mail secret like this:
|
||||||
|
#
|
||||||
|
# abra app secret insert APP email_config v1 "URL"
|
||||||
|
#
|
||||||
|
# Where URL is
|
||||||
|
# smtp+ssl://user:password@youremail.host:465
|
||||||
|
# smtp://user:password@youremail.host:25
|
||||||
|
# smtp+tls://user:password@youremail.host:587
|
||||||
|
SECRET_EMAIL_CONFIG_VERSION=v1
|
||||||
|
|
||||||
|
# DEFAULT_FROM_EMAIL=noreply@yourdomain
|
||||||
|
|
||||||
|
# Make e-mail verification mandatory before using the service
|
||||||
|
ACCOUNT_EMAIL_VERIFICATION_ENFORCE=true
|
||||||
|
@ -30,6 +30,4 @@ For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).
|
|||||||
Before you deploy: `abra app cmd <app> secrets --local`
|
Before you deploy: `abra app cmd <app> secrets --local`
|
||||||
|
|
||||||
After you deploy:
|
After you deploy:
|
||||||
- `cp -r frontend/* /srv/funkwhale/front/dist`
|
- `abra app cmd -T <app> api admin`
|
||||||
- `abra app cmd <app> api migrate`
|
|
||||||
- `abra app cmd <app> api admin`
|
|
||||||
|
2
abra.sh
2
abra.sh
@ -1,5 +1,5 @@
|
|||||||
export NGINX_CONFIG_VERSION=v2
|
export NGINX_CONFIG_VERSION=v2
|
||||||
export APP_ENTRYPOINT_VERSION=v1
|
export APP_ENTRYPOINT_VERSION=v2
|
||||||
|
|
||||||
secrets() {
|
secrets() {
|
||||||
docker context use default > /dev/null 2>&1
|
docker context use default > /dev/null 2>&1
|
||||||
|
89
compose.yml
89
compose.yml
@ -2,39 +2,60 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
x-environment: &default-env
|
x-environment: &default-env
|
||||||
|
- FUNKWHALE_HOSTNAME=${HOSTNAME}
|
||||||
|
- FUNKWHALE_PROTOCOL=https
|
||||||
|
- REVERSE_PROXY_TYPE=nginx
|
||||||
|
- DJANGO_SETTINGS_MODULE=config.settings.production
|
||||||
|
- FUNKWHALE_API_IP=127.0.0.1
|
||||||
|
- FUNKWHALE_API_PORT=5000
|
||||||
- CACHE_URL=redis://cache:6379/0
|
- CACHE_URL=redis://cache:6379/0
|
||||||
|
- DEFAULT_FROM_EMAIL=noreply@${DOMAIN}
|
||||||
|
- FUNKWHALE_WEB_WORKERS
|
||||||
|
- LOGLEVEL
|
||||||
|
- ACCOUNT_EMAIL_VERIFICATION_ENFORCE
|
||||||
- CELERYD_CONCURRENCY
|
- CELERYD_CONCURRENCY
|
||||||
- C_FORCE_ROOT=true
|
- C_FORCE_ROOT=true
|
||||||
- DATABASE_PASSWORD_FILE=/run/secrets/db_password
|
- DATABASE_PASSWORD_FILE=/run/secrets/db_password
|
||||||
- DJANGO_SECRET_KEY_FILE=/run/secrets/django_secret_key
|
- DJANGO_SECRET_KEY_FILE=/run/secrets/django_secret_key
|
||||||
- DJANGO_SETTINGS_MODULE
|
|
||||||
- DOMAIN
|
- DOMAIN
|
||||||
- FUNKWHALE_FRONTEND_PATH=/srv/funkwhale/front/dist
|
- NGINX_MAX_BODY_SIZE
|
||||||
- FUNKWHALE_HOSTNAME
|
|
||||||
- FUNKWHALE_WEB_WORKERS
|
|
||||||
- LOGLEVEL
|
|
||||||
- MEDIA_ROOT=/srv/funkwhale/data/media
|
- MEDIA_ROOT=/srv/funkwhale/data/media
|
||||||
- MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music
|
|
||||||
- MUSIC_DIRECTORY_SERVE_PATH=/srv/funkwhale/data/music
|
|
||||||
- REVERSE_PROXY_TYPE
|
|
||||||
- STACK_NAME
|
|
||||||
- STATIC_ROOT=/srv/funkwhale/data/static
|
- STATIC_ROOT=/srv/funkwhale/data/static
|
||||||
|
- MUSIC_DIRECTORY_PATH=/music
|
||||||
|
- MUSIC_DIRECTORY_SERVE_PATH=/srv/funkwhale/data/music
|
||||||
|
- STACK_NAME
|
||||||
|
|
||||||
x-secrets: &default-secrets
|
x-secrets: &default-secrets
|
||||||
- db_password
|
- db_password
|
||||||
- django_secret_key
|
- django_secret_key
|
||||||
|
|
||||||
x-volumes: &default-volumes
|
|
||||||
- music-data:/srv/funkwhale/data/music:ro
|
|
||||||
- media-data:/srv/funkwhale/data/media
|
|
||||||
- static-data:/srv/funkwhale/data/static
|
|
||||||
- frontend-data:/srv/funkwhale/front/dist:ro
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
api:
|
||||||
image: nginx:1.27.1
|
image: funkwhale/api:1.4.0
|
||||||
environment: *default-env
|
environment: *default-env
|
||||||
volumes: *default-volumes
|
secrets: *default-secrets
|
||||||
|
volumes:
|
||||||
|
- music-data:/music:ro
|
||||||
|
- media-data:/srv/funkwhale/data/media
|
||||||
|
- static-data:/srv/funkwhale/data/static
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- cache
|
||||||
|
configs:
|
||||||
|
- source: app_entrypoint
|
||||||
|
target: /docker-entrypoint.sh
|
||||||
|
mode: 0555
|
||||||
|
entrypoint: /docker-entrypoint.sh
|
||||||
|
command: /app/compose/django/server.sh
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
app:
|
||||||
|
image: funkwhale/front:1.4.0
|
||||||
|
environment: *default-env
|
||||||
|
volumes:
|
||||||
|
- music-data:/music:ro
|
||||||
|
- media-data:/srv/funkwhale/data/media:ro
|
||||||
|
- static-data:/usr/share/nginx/html/staticfiles:ro
|
||||||
configs:
|
configs:
|
||||||
- source: nginx_config
|
- source: nginx_config
|
||||||
target: /etc/nginx/nginx.conf
|
target: /etc/nginx/nginx.conf
|
||||||
@ -53,27 +74,33 @@ services:
|
|||||||
- "coop-cloud.${STACK_NAME}.version=0.1.1+1.27.1"
|
- "coop-cloud.${STACK_NAME}.version=0.1.1+1.27.1"
|
||||||
|
|
||||||
celeryworker:
|
celeryworker:
|
||||||
image: funkwhale/funkwhale:1.2
|
image: funkwhale/api:1.4.0
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- cache
|
- cache
|
||||||
environment: *default-env
|
environment: *default-env
|
||||||
secrets: *default-secrets
|
secrets: *default-secrets
|
||||||
volumes: *default-volumes
|
volumes:
|
||||||
|
- music-data:/music:ro
|
||||||
|
- media-data:/srv/funkwhale/data/media
|
||||||
configs:
|
configs:
|
||||||
- source: app_entrypoint
|
- source: app_entrypoint
|
||||||
target: /docker-entrypoint.sh
|
target: /docker-entrypoint.sh
|
||||||
mode: 0555
|
mode: 0555
|
||||||
entrypoint: /docker-entrypoint.sh
|
entrypoint: /docker-entrypoint.sh
|
||||||
command: celery -A funkwhale_api.taskapp worker -l INFO
|
command:
|
||||||
|
- celery
|
||||||
|
- --app=funkwhale_api.taskapp
|
||||||
|
- worker
|
||||||
|
- --loglevel=${LOGLEVEL}
|
||||||
|
- --concurrency=${CELERYD_CONCURRENCY:-0}
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
|
||||||
celerybeat:
|
celerybeat:
|
||||||
image: funkwhale/funkwhale:1.2
|
image: funkwhale/funkwhale:1.4.0
|
||||||
environment: *default-env
|
environment: *default-env
|
||||||
secrets: *default-secrets
|
secrets: *default-secrets
|
||||||
volumes: *default-volumes
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- cache
|
- cache
|
||||||
@ -86,22 +113,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
|
||||||
api:
|
|
||||||
image: funkwhale/funkwhale:1.2
|
|
||||||
environment: *default-env
|
|
||||||
secrets: *default-secrets
|
|
||||||
volumes: *default-volumes
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- cache
|
|
||||||
configs:
|
|
||||||
- source: app_entrypoint
|
|
||||||
target: /docker-entrypoint.sh
|
|
||||||
mode: 0555
|
|
||||||
entrypoint: /docker-entrypoint.sh
|
|
||||||
command: /app/compose/django/server.sh
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:10-alpine
|
image: postgres:10-alpine
|
||||||
|
@ -29,6 +29,9 @@ export DATABASE_URL="postgres://funkwhale:$DATABASE_PASSWORD@db:5432/funkwhale"
|
|||||||
|
|
||||||
file_env "DJANGO_SECRET_KEY"
|
file_env "DJANGO_SECRET_KEY"
|
||||||
|
|
||||||
|
# migrate before starting
|
||||||
|
python manage.py migrate
|
||||||
|
|
||||||
# upstream entrypoint
|
# upstream entrypoint
|
||||||
# https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/api/Dockerfile
|
# https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/api/Dockerfile
|
||||||
/app/compose/django/entrypoint.sh "$@"
|
/app/compose/django/entrypoint.sh "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user