diff --git a/.gitignore b/.gitignore index d53908c4542a1e4fafaf81c572395b686a42260d..b2d6c1a862a5b818851738c9bdc95b57ab13e8fd 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ mailhog *.sqlite3 music +media +staticfiles +static diff --git a/config/settings/common.py b/config/settings/common.py index ceee21f9467a615b976ced99fa742518ca698000..5c55dfdc164fee32b469a1b3ce2c2ccb514979a0 100644 --- a/config/settings/common.py +++ b/config/settings/common.py @@ -199,7 +199,7 @@ CRISPY_TEMPLATE_PACK = 'bootstrap3' STATIC_ROOT = str(ROOT_DIR('staticfiles')) # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url -STATIC_URL = '/static/' +STATIC_URL = env("STATIC_URL", default='/static/') # See: https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#std:setting-STATICFILES_DIRS STATICFILES_DIRS = ( diff --git a/demo/load-demo-data.sh b/demo/load-demo-data.sh index aae3b30c8dde5a3ddee7623fe00b294e7083a387..c09c5075e8b1bdd19b9260d96439704b74f6b2da 100755 --- a/demo/load-demo-data.sh +++ b/demo/load-demo-data.sh @@ -10,4 +10,4 @@ cat demo/demo-user.py | python manage.py shell --plain echo "Importing demo tracks..." -python manage.py import_files "/app/music/**/*.ogg" --recursive --noinput +python manage.py import_files "/music/**/*.ogg" --recursive --noinput diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..4f79eb301b1241c91573c7e4d34d70686f82e7c2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,42 @@ +version: '2' +services: + postgres: + image: postgres:9.5 + + api: + build: . + links: + - postgres + - redis + command: ./compose/django/gunicorn.sh + env_file: .env + volumes: + - ./media:/app/funkwhale_api/media + - ./staticfiles:/app/staticfiles + - ./music:/music + ports: + - "127.0.0.1:6001:5000" + + redis: + image: redis:3.0 + + celeryworker: + build: . + env_file: .env + links: + - postgres + - redis + command: celery -A funkwhale_api.taskapp worker -l INFO + volumes: + - ./media:/app/funkwhale_api/media + - ./music:/music + environment: + - C_FORCE_ROOT=True + + celerybeat: + build: . + env_file: .env + links: + - postgres + - redis + command: celery -A funkwhale_api.taskapp beat -l INFO