Removed some env variables from nginx template and some additional cleaning

master
Meliurwen 4 years ago
parent df3ad69a5a
commit 92b1061fb6
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 10
      .env.example
  2. 5
      all.env.example
  3. 25
      docker-compose.yml
  4. 14
      nginx/funkwhale.template

@ -1,6 +1,10 @@
# Global Settings # Global Settings
TZ=Etc/UTC TZ=Etc/UTC
LOCAL_STACK_DIR=/srv/docker/volumes/funkwhale LOCAL_STACK_DIR=/srv/docker/volumes/funkwhale
# 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=
# Global Settings (optional) # Global Settings (optional)
FUNKWHALE_VERSION= FUNKWHALE_VERSION=
@ -20,6 +24,12 @@ RD_TAG=
RD_CONTAINER_NAME= RD_CONTAINER_NAME=
RD_RESTART= RD_RESTART=
# nginx (optional)
WB_IMG=
WB_TAG=
WB_CONTAINER_NAME=
WB_RESTART=
CELERYD_CONCURRENCY= CELERYD_CONCURRENCY=

@ -37,10 +37,7 @@ FUNKWHALE_API_PORT=5000
# The number of web workers to start in parallel. Higher means you can handle # The number of web workers to start in parallel. Higher means you can handle
# 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=1 FUNKWHALE_WEB_WORKERS=1
# 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=msubdomain.domain.tld
FUNKWHALE_PROTOCOL=https FUNKWHALE_PROTOCOL=https
# Configure email sending using this variale # Configure email sending using this variale

@ -28,11 +28,12 @@ services:
- postgres - postgres
- redis - redis
volumes: volumes:
- "${MUSIC_DIRECTORY_SERVE_PATH-/srv/docker/volumes/funkwhale/media/import_music}:${MUSIC_DIRECTORY_PATH-/music}:ro" - "${MUSIC_DIRECTORY_SERVE_PATH}:/music:ro"
- "${MEDIA_ROOT}:${MEDIA_ROOT}" - "${MEDIA_ROOT}:${MEDIA_ROOT}"
env_file: all.env env_file: all.env
environment: environment:
- C_FORCE_ROOT=true - C_FORCE_ROOT=true
- FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME}
# Celery workers handle background tasks (such file imports or federation # Celery workers handle background tasks (such file imports or federation
# messaging). The more processes a worker gets, the more tasks # messaging). The more processes a worker gets, the more tasks
# can be processed in parallel. However, more processes also means # can be processed in parallel. However, more processes also means
@ -50,6 +51,8 @@ services:
- postgres - postgres
- redis - redis
env_file: all.env env_file: all.env
environment:
- FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME}
command: celery -A funkwhale_api.taskapp beat --pidfile= -l INFO command: celery -A funkwhale_api.taskapp beat --pidfile= -l INFO
api: api:
@ -59,31 +62,35 @@ services:
- postgres - postgres
- redis - redis
volumes: volumes:
- "${MUSIC_DIRECTORY_SERVE_PATH-/srv/docker/volumes/funkwhale/media/import_music}:${MUSIC_DIRECTORY_PATH-/music}:ro" - "${MUSIC_DIRECTORY_SERVE_PATH}:/music:ro"
- "${MEDIA_ROOT}:${MEDIA_ROOT}" - "${MEDIA_ROOT}:${MEDIA_ROOT}"
- "${STATIC_ROOT}:${STATIC_ROOT}" - "${STATIC_ROOT}:${STATIC_ROOT}"
- "${FUNKWHALE_FRONTEND_PATH}:/frontend" - "${FUNKWHALE_FRONTEND_PATH}:/frontend"
expose: expose:
- 5000 - 5000
env_file: all.env env_file: all.env
environment:
- FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME}
nginx: nginx:
image: nginx image: ${WB_IMG:-nginx}:${WB_TAG:-latest}
restart: unless-stopped container_name: ${WB_CONTAINER_NAME:-funkwhale-web}
restart: ${WB_RESTART:-unless-stopped}
depends_on: depends_on:
- api - api
volumes: volumes:
- "./nginx/funkwhale.template:/etc/nginx/conf.d/funkwhale.template:ro" - "./nginx/funkwhale.template:/etc/nginx/conf.d/funkwhale.template:ro"
- "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro" - "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro"
- "${MUSIC_DIRECTORY_SERVE_PATH-/srv/docker/volumes/funkwhale/media/import_music}:${MUSIC_DIRECTORY_SERVE_PATH-/srv/docker/volumes/funkwhale/media/import_music}:ro" - "${MUSIC_DIRECTORY_SERVE_PATH}:/srv/wwww/music:ro"
- "${MEDIA_ROOT}:${MEDIA_ROOT}:ro" - "${MEDIA_ROOT}:/srv/wwww/media:ro"
- "${STATIC_ROOT}:${STATIC_ROOT}:ro" - "${STATIC_ROOT}:/srv/wwww/static:ro"
- "${FUNKWHALE_FRONTEND_PATH}:/frontend:ro" - "${FUNKWHALE_FRONTEND_PATH}:/srv/wwww/frontend:ro"
expose: expose:
- 80 - 80
env_file: env_file:
- all.env
- nginx.env - nginx.env
environment:
- FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME}
command: > command: >
sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\" sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\"
< /etc/nginx/conf.d/funkwhale.template < /etc/nginx/conf.d/funkwhale.template

@ -21,7 +21,7 @@ server {
# have a look here for let's encrypt configuration: # have a look here for let's encrypt configuration:
# https://certbot.eff.org/all-instructions/#debian-9-stretch-nginx # https://certbot.eff.org/all-instructions/#debian-9-stretch-nginx
root /frontend; root /srv/wwww/frontend;
# If you are using S3 to host your files, remember to add your S3 URL to the # If you are using S3 to host your files, remember to add your S3 URL to the
# media-src and img-src headers (e.g. img-src 'self' https://<your-S3-URL> data:) # media-src and img-src headers (e.g. img-src 'self' https://<your-S3-URL> data:)
@ -42,7 +42,7 @@ server {
add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Service-Worker-Allowed "/"; add_header Service-Worker-Allowed "/";
add_header X-Frame-Options "ALLOW"; add_header X-Frame-Options "ALLOW";
alias /frontend/; alias /srv/wwww/frontend/;
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Cache-Control "public, must-revalidate, proxy-revalidate";
@ -53,7 +53,7 @@ server {
add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header X-Frame-Options "ALLOW"; add_header X-Frame-Options "ALLOW";
alias /frontend/embed.html; alias /srv/wwww/frontend/embed.html;
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Cache-Control "public, must-revalidate, proxy-revalidate";
@ -76,7 +76,7 @@ server {
} }
location /media/ { location /media/ {
alias ${MEDIA_ROOT}/; alias /srv/wwww/media/;
} }
# this is an internal location that is used to serve # this is an internal location that is used to serve
@ -84,7 +84,7 @@ server {
# has been checked on API side # has been checked on API side
location /_protected/media { location /_protected/media {
internal; internal;
alias ${MEDIA_ROOT}; alias /srv/wwww/media;
} }
# Comment the previous location and uncomment this one if you're storing # Comment the previous location and uncomment this one if you're storing
@ -102,11 +102,11 @@ server {
# has been checked on API side # has been checked on API side
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting # Set this to the same value as your MUSIC_DIRECTORY_PATH setting
internal; internal;
alias ${MUSIC_DIRECTORY_PATH}; alias /srv/wwww/music;
} }
location /staticfiles/ { location /staticfiles/ {
# django static files # django static files
alias ${STATIC_ROOT}/; alias /srv/wwww/static/;
} }
} }

Loading…
Cancel
Save