Compose: Compose, Docker frontend + CI environment

This commit is contained in:
jon r 2025-04-17 12:12:41 +02:00
parent 7376c85521
commit 9fd8bbd5b6
17 changed files with 214 additions and 155 deletions

View File

@ -1,3 +1,5 @@
COMPOSE_BAKE=true
# api + celeryworker
DEBUG=True
DEFAULT_FROM_EMAIL=hello@funkwhale.test

21
.gitignore vendored
View File

@ -34,6 +34,8 @@ pip-log.txt
.tox
nosetests.xml
htmlcov
coverage.xml
report.xml
# Translations
*.mo
@ -75,11 +77,13 @@ api/staticfiles
api/static
api/.pytest_cache
api/celerybeat-*
# Front
oldfront/node_modules/
front/static/translations
front/node_modules/
front/dist/
front/dev-dist/
front/npm-debug.log*
front/yarn-debug.log*
front/yarn-error.log*
@ -88,7 +92,16 @@ front/tests/e2e/reports
front/test_results.xml
front/coverage/
front/selenium-debug.log
# Vitepress
front/ui-docs/.vitepress/.vite
front/ui-docs/.vitepress/cache
front/ui-docs/.vitepress/dist
front/ui-docs/public
# Docs
docs/_build
#Tauri
front/tauri/gen
@ -116,8 +129,14 @@ tsconfig.tsbuildinfo
flake.nix
flake.lock
# Vscode
# VS Code
.vscode/
# Zed
.zed/
# Node version (asdf)
.tool-versions
# Lychee link checker
.lycheecache

View File

@ -8,50 +8,56 @@ include:
file: /templates/ssh-agent.yml
variables:
PYTHONDONTWRITEBYTECODE: "true"
PYTHONDONTWRITEBYTECODE: 'true'
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
YARN_CACHE_FOLDER: $CI_PROJECT_DIR/.cache/yarn
POETRY_VIRTUALENVS_IN_PROJECT: "true"
POETRY_VIRTUALENVS_IN_PROJECT: 'true'
.shared_variables:
# Keep the git files permissions during job setup
keep_git_files_permissions: &keep_git_files_permissions
GIT_STRATEGY: clone
GIT_DEPTH: "5"
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true"
GIT_DEPTH: '5'
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 'true'
.shared_caches:
# Cache for front related jobs
front_cache: &front_cache
- key: front-yarn
paths: [$YARN_CACHE_FOLDER]
- key:
prefix: front-node_modules
files: [front/yarn.lock]
paths: [front/node_modules]
- key:
prefix: front-lint
files:
- front/.eslintcache
- front/tsconfig.tsbuildinfo
yarn_cache: &yarn_cache
key: front-yarn-$CI_COMMIT_REF_SLUG
paths: [$YARN_CACHE_FOLDER]
node_cache: &node_cache
key:
prefix: front-node_modules-$CI_COMMIT_REF_SLUG
files: [front/yarn.lock]
paths: [front/node_modules]
lint_cache: &lint_cache
key:
prefix: front-lint-$CI_COMMIT_REF_SLUG
files:
- front/.eslintcache
- front/tsconfig.tsbuildinfo
cypress_cache: &cypress_cache
key: cypress-cache-$CI_COMMIT_REF_SLUG
paths:
- /root/.cache/Cypress
# Cache for api related jobs
# Include the python version to prevent loosing caches in the test matrix
api_cache: &api_cache
- key: api-pip-$PYTHON_VERSION
- key: api-pip-$CI_COMMIT_REF_SLUG
paths: [$PIP_CACHE_DIR]
- key:
prefix: api-venv-$PYTHON_VERSION
prefix: api-venv-$CI_COMMIT_REF_SLUG
files: [api/poetry.lock]
paths: [api/.venv]
# Cache for docs related jobs
docs_cache: &docs_cache
- key: docs-pip
- key: docs-pip-$CI_COMMIT_REF_SLUG
paths: [$PIP_CACHE_DIR]
- key:
prefix: docs-venv
prefix: docs-venv-$CI_COMMIT_REF_SLUG
files: [docs/poetry.lock]
paths: [docs/.venv]
@ -97,7 +103,10 @@ review_front:
environment:
name: review/front/$CI_COMMIT_REF_NAME
url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/index.html
cache: *front_cache
cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script:
- mkdir front-review
- cd front
@ -143,6 +152,7 @@ find_broken_links:
lychee
--cache
--no-progress
--include-fragments
--exclude-all-private
--exclude 'demo\.funkwhale\.audio'
--exclude 'nginx\.com'
@ -150,6 +160,7 @@ find_broken_links:
-- . || exit $?
require_changelog:
allow_failure: false
stage: lint
rules:
# Don't run on merge request that mention NOCHANGELOG or renovate bot commits
@ -174,7 +185,7 @@ lint_api:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
- changes: [api/**/*]
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.13
cache: *api_cache
before_script:
- cd api
@ -190,13 +201,15 @@ lint_front:
- changes: [front/**/*]
image: $CI_REGISTRY/funkwhale/ci/node-python:18
cache: *front_cache
cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script:
- cd front
- yarn install --frozen-lockfile
script:
- yarn lint --max-warnings 0
- yarn lint:tsc
- yarn lint
test_scripts:
stage: test
@ -231,7 +244,7 @@ test_api:
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:$PYTHON_VERSION
parallel:
matrix:
- PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11", "3.12"]
- PYTHON_VERSION: ['3.10', '3.11', '3.12', '3.13']
services:
- name: postgres:15-alpine
command:
@ -241,11 +254,11 @@ test_api:
- name: redis:7-alpine
cache: *api_cache
variables:
DATABASE_URL: "postgresql://postgres@postgres/postgres"
FUNKWHALE_URL: "https://funkwhale.ci"
DATABASE_URL: 'postgresql://postgres@postgres/postgres'
FUNKWHALE_URL: 'https://funkwhale.ci'
DJANGO_SETTINGS_MODULE: config.settings.local
POSTGRES_HOST_AUTH_METHOD: trust
CACHE_URL: "redis://redis:6379/0"
CACHE_URL: 'redis://redis:6379/0'
before_script:
- cd api
- make install
@ -276,7 +289,10 @@ test_front:
- changes: [front/**/*]
image: $CI_REGISTRY/funkwhale/ci/node-python:18
cache: *front_cache
cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script:
- cd front
- yarn install --frozen-lockfile
@ -315,12 +331,13 @@ test_integration:
image:
name: cypress/included:13.6.4
entrypoint: [""]
entrypoint: ['']
cache:
- *front_cache
- key:
paths:
- /root/.cache/Cypress
- *yarn_cache
- *node_cache
- *lint_cache
- *cypress_cache
before_script:
- cd front
- yarn install
@ -338,24 +355,29 @@ build_api_schema:
# Add build_docs rules because it depends on the build_api_schema artifact
- changes: [docs/**/*]
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.13
services:
- postgres:15-alpine
- redis:7-alpine
cache: *api_cache
variables:
DATABASE_URL: "postgresql://postgres@postgres/postgres"
FUNKWHALE_URL: "https://funkwhale.ci"
DATABASE_URL: 'postgresql://postgres@postgres/postgres'
FUNKWHALE_URL: 'https://funkwhale.ci'
DJANGO_SETTINGS_MODULE: config.settings.local
POSTGRES_HOST_AUTH_METHOD: trust
CACHE_URL: "redis://redis:6379/0"
API_TYPE: "v1"
CACHE_URL: 'redis://redis:6379/0'
API_TYPE: 'v1'
before_script:
- cd api
- make install
- poetry run funkwhale-manage migrate
script:
- poetry run funkwhale-manage spectacular --file ../docs/schema.yml
- diff ../docs/schema.yml ./funkwhale_api/common/schema.yml || (
echo "Schema files do not match! run sudo docker compose run --rm
api funkwhale-manage spectacular > ./api/funkwhale_api/common/schema.yml" &&
exit 1
)
artifacts:
expire_in: 2 weeks
paths:
@ -397,7 +419,10 @@ build_front:
variables:
<<: *keep_git_files_permissions
NODE_OPTIONS: --max-old-space-size=4096
cache: *front_cache
cache:
- *yarn_cache
- *node_cache
- *lint_cache
before_script:
- cd front
- yarn install --frozen-lockfile
@ -431,24 +456,24 @@ build_api:
paths:
- api
build_tauri:
stage: build
rules:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
- changes: [front/**/*]
# build_tauri:
# stage: build
# rules:
# - if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
# - changes: [front/**/*]
image: $CI_REGISTRY/funkwhale/ci/node-tauri:18
variables:
<<: *keep_git_files_permissions
before_script:
- source /root/.cargo/env
- yarn install
script:
- yarn tauri build --verbose
artifacts:
name: desktop_${CI_COMMIT_REF_NAME}
paths:
- front/tauri/target/release/bundle/appimage/*.AppImage
# image: $CI_REGISTRY/funkwhale/ci/node-tauri:18
# variables:
# <<: *keep_git_files_permissions
# before_script:
# - source /root/.cargo/env
# - yarn install
# script:
# - yarn tauri build --verbose
# artifacts:
# name: desktop_${CI_COMMIT_REF_NAME}
# paths:
# - front/tauri/target/release/bundle/appimage/*.AppImage
deploy_docs:
interruptible: false
@ -507,7 +532,7 @@ docker:
<<: *keep_git_files_permissions
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_TLS_CERTDIR: ''
BUILDKIT_PROGRESS: plain
DOCKER_CACHE_IMAGE: $CI_REGISTRY/funkwhale/funkwhale/cache
@ -539,8 +564,8 @@ package:
artifacts: true
- job: build_front
artifacts: true
- job: build_tauri
artifacts: true
# - job: build_tauri
# artifacts: true
rules:
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/

View File

@ -1,19 +1,19 @@
version: "3"
version: '3'
services:
postgres:
image: postgres:15-alpine
environment:
- "POSTGRES_HOST_AUTH_METHOD=trust"
- 'POSTGRES_HOST_AUTH_METHOD=trust'
volumes:
- "../data/postgres:/var/lib/postgresql/data"
- '../data/postgres:/var/lib/postgresql/data'
ports:
- 5432:5432
redis:
image: redis:7-alpine
volumes:
- "../data/redis:/data"
- '../data/redis:/data'
ports:
- 6379:6379
@ -26,14 +26,14 @@ services:
extra_hosts:
- host.docker.internal:host-gateway
environment:
- "NGINX_MAX_BODY_SIZE=100M"
- "FUNKWHALE_API_IP=host.docker.internal"
- "FUNKWHALE_API_HOST=host.docker.internal"
- "FUNKWHALE_API_PORT=5000"
- "FUNKWHALE_FRONT_IP=host.docker.internal"
- "FUNKWHALE_FRONT_PORT=8080"
- "FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-host.docker.internal}"
- "FUNKWHALE_PROTOCOL=https"
- 'NGINX_MAX_BODY_SIZE=100M'
- 'FUNKWHALE_API_IP=host.docker.internal'
- 'FUNKWHALE_API_HOST=host.docker.internal'
- 'FUNKWHALE_API_PORT=5000'
- 'FUNKWHALE_FRONT_IP=host.docker.internal'
- 'FUNKWHALE_FRONT_PORT=8080'
- 'FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME-host.docker.internal}'
- 'FUNKWHALE_PROTOCOL=https'
volumes:
- ../data/media:/workspace/funkwhale/data/media:ro
- ../data/music:/music:ro

View File

@ -6,6 +6,8 @@ repos:
rev: v4.4.0
hooks:
- id: check-added-large-files
exclude: 'api/funkwhale_api/common/schema.yml'
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
@ -62,6 +64,7 @@ repos:
hooks:
- id: prettier
files: \.(md|yml|yaml|json)$
exclude: 'api/funkwhale_api/common/schema.yml'
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6

View File

@ -13,17 +13,17 @@ x-django: &django
- EXTERNAL_REQUESTS_VERIFY_SSL
- "FORCE_HTTPS_URLS=${FORCE_HTTPS_URLS:-False}"
- 'FORCE_HTTPS_URLS=${FORCE_HTTPS_URLS:-False}'
- FUNKWHALE_PROTOCOL
- "FUNKWHALE_HOSTNAME=${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}"
- 'FUNKWHALE_HOSTNAME=${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}'
- DATABASE_URL
- CACHE_URL
- EMAIL_CONFIG
- TYPESENSE_API_KEY
- "STATIC_URL=${FUNKWHALE_PROTOCOL}://${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}/static/"
- "MEDIA_URL=${FUNKWHALE_PROTOCOL}://${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}/media/"
- 'STATIC_URL=${FUNKWHALE_PROTOCOL}://${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}/static/'
- 'MEDIA_URL=${FUNKWHALE_PROTOCOL}://${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}/media/'
- STATIC_ROOT
- MEDIA_ROOT
@ -31,7 +31,7 @@ x-django: &django
- FUNKWHALE_SPA_HTML_ROOT
- LDAP_ENABLED
- BROWSABLE_API_ENABLED
- "MUSIC_DIRECTORY_PATH=${MUSIC_DIRECTORY_PATH:-/music}"
- 'MUSIC_DIRECTORY_PATH=${MUSIC_DIRECTORY_PATH:-/music}'
- C_FORCE_ROOT
- PYTHONDONTWRITEBYTECODE
@ -46,17 +46,14 @@ services:
context: ./front
dockerfile: Dockerfile.dev
ports:
- "${VUE_PORT:-8080}:${VUE_PORT:-8080}"
- '${VUE_PORT:-8080}:${VUE_PORT:-8080}'
environment:
- HOST
- VUE_PORT
volumes:
- "./front:/app"
- "/app/node_modules"
- "./po:/po"
- './front:/app'
- '/app/node_modules'
networks:
- internal
command: "yarn dev --host"
api:
extends:
@ -75,8 +72,8 @@ services:
file: ./compose/app.nginx.yml
service: nginx
environment:
- "MUSIC_DIRECTORY_PATH=${MUSIC_DIRECTORY_PATH:-/music}"
- "FUNKWHALE_HOSTNAME=${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}"
- 'MUSIC_DIRECTORY_PATH=${MUSIC_DIRECTORY_PATH:-/music}'
- 'FUNKWHALE_HOSTNAME=${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}'
- FUNKWHALE_PROTOCOL
@ -89,34 +86,34 @@ services:
- NGINX_MAX_BODY_SIZE
- STATIC_ROOT
- "MEDIA_ROOT=${MEDIA_ROOT:-/data/media}"
- 'MEDIA_ROOT=${MEDIA_ROOT:-/data/media}'
networks:
- web
- internal
labels:
- "traefik.enable=true"
- 'traefik.enable=true'
- "traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-web.rule=Host(`${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}`)"
- "traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-web.entrypoints=web"
- 'traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-web.rule=Host(`${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}`)'
- 'traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-web.entrypoints=web'
- "traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.rule=Host(`${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}`)"
- "traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.entrypoints=webs"
- 'traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.rule=Host(`${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}`)'
- 'traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.entrypoints=webs'
- "traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.tls=true"
- "traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.tls.domains[0].main=${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}"
- 'traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.tls=true'
- 'traefik.http.routers.test-funkwhale-${COMPOSE_PROJECT_NAME:-funkwhale}-webs.tls.domains[0].main=${COMPOSE_PROJECT_NAME:-funkwhale}.${FUNKWHALE_DOMAIN}'
postgres:
image: "postgres:${POSTGRES_VERSION:-15}-alpine"
image: 'postgres:${POSTGRES_VERSION:-15}-alpine'
environment:
- POSTGRES_HOST_AUTH_METHOD
command: postgres ${POSTGRES_ARGS:-}
volumes:
- "./.state/${COMPOSE_PROJECT_NAME:-funkwhale}/postgres:/var/lib/postgresql/data"
- './.state/${COMPOSE_PROJECT_NAME:-funkwhale}/postgres:/var/lib/postgresql/data'
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
@ -124,11 +121,11 @@ services:
redis:
image: redis:7-alpine
volumes:
- "./.state/${COMPOSE_PROJECT_NAME:-funkwhale}/redis:/data"
- './.state/${COMPOSE_PROJECT_NAME:-funkwhale}/redis:/data'
networks:
- internal
healthcheck:
test: ["CMD", "redis-cli", "ping"]
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 3

View File

@ -2,11 +2,12 @@ x-django: &django
image: funkwhale-api
volumes:
- ../api:/app
- "${MUSIC_DIRECTORY_SERVE_PATH:-../.state/music}:/music:ro"
- "../.state/plugins:/srv/funkwhale/plugins"
- "../.state/staticfiles:/staticfiles"
- "../.state/media:/protected/media"
- "../.state/${COMPOSE_PROJECT_NAME:-funkwhale}/media:/data/media"
- ../.env:/app/.env
- '${MUSIC_DIRECTORY_SERVE_PATH:-../.state/music}:/music:ro'
- '../.state/plugins:/srv/funkwhale/plugins'
- '../.state/staticfiles:/staticfiles'
- '../.state/media:/protected/media'
- '../.state/${COMPOSE_PROJECT_NAME:-funkwhale}/media:/data/media'
depends_on:
postgres:
condition: service_healthy
@ -21,9 +22,13 @@ services:
build:
context: ../api
dockerfile: Dockerfile.debian
healthcheck:
test: ['CMD-SHELL', 'docker compose logs api | grep -q "Uvicorn running on" || exit 0']
interval: 3s
timeout: 5s
retries: 3
command: >
sh -c "
funkwhale-manage migrate &&
funkwhale-manage collectstatic --no-input &&
uvicorn --reload config.asgi:application --host 0.0.0.0 --port 5000 --reload-dir config/ --reload-dir funkwhale_api/
"
@ -35,3 +40,6 @@ services:
pip install watchdog[watchmedo] &&
watchmedo auto-restart --patterns="*.py" --recursive -- celery -A funkwhale_api.taskapp worker -l debug -B --concurrency=${CELERYD_CONCURRENCY}
'
depends_on:
api:
condition: service_healthy

View File

@ -5,7 +5,7 @@ services:
- api
- front
volumes:
- "${MUSIC_DIRECTORY_SERVE_PATH:-../.state/music}:${MUSIC_DIRECTORY_PATH:-/music}:ro"
- '${MUSIC_DIRECTORY_SERVE_PATH:-../.state/music}:${MUSIC_DIRECTORY_PATH:-/music}:ro'
- ./etc/nginx/conf.dev:/etc/nginx/templates/default.conf.template:ro
- ../deploy/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro

View File

@ -2,18 +2,18 @@ services:
openapi:
image: swaggerapi/swagger-ui
environment:
- "URL=/openapi.yml"
- 'URL=/openapi.yml'
ports:
- "8002:8080"
- '8002:8080'
volumes:
- "../docs/specs/nodeinfo21/schema.yml:/usr/share/nginx/html/openapi.yml"
- '../docs/specs/nodeinfo21/schema.yml:/usr/share/nginx/html/openapi.yml'
# - "../docs/api:/usr/share/nginx/html/api"
labels:
- "traefik.enable=true"
- "traefik.http.routers.test-funkwhale-openapi-web.rule=Host(`openapi.funkwhale.test`)"
- "traefik.http.routers.test-funkwhale-openapi-web.entrypoints=web"
- "traefik.http.services.test-funkwhale-openapi.loadbalancer.server.port=8080"
- "traefik.http.routers.test-funkwhale-openapi-webs.rule=Host(`openapi.funkwhale.test`)"
- "traefik.http.routers.test-funkwhale-openapi-webs.entrypoints=webs"
- "traefik.http.routers.test-funkwhale-openapi-webs.tls=true"
networks: ["web"]
- 'traefik.enable=true'
- 'traefik.http.routers.test-funkwhale-openapi-web.rule=Host(`openapi.funkwhale.test`)'
- 'traefik.http.routers.test-funkwhale-openapi-web.entrypoints=web'
- 'traefik.http.services.test-funkwhale-openapi.loadbalancer.server.port=8080'
- 'traefik.http.routers.test-funkwhale-openapi-webs.rule=Host(`openapi.funkwhale.test`)'
- 'traefik.http.routers.test-funkwhale-openapi-webs.entrypoints=webs'
- 'traefik.http.routers.test-funkwhale-openapi-webs.tls=true'
networks: ['web']

View File

@ -4,16 +4,16 @@ services:
context: ../
dockerfile: docs/Dockerfile
init: true
ports: ["8001:8001"]
ports: ['8001:8001']
command: sh -c 'cd /src/docs && make dev'
volumes:
- ../docs:/src/docs
labels:
- "traefik.enable=true"
- "traefik.http.routers.test-funkwhale-docs-web.rule=Host(`docs.funkwhale.test`)"
- "traefik.http.routers.test-funkwhale-docs-web.entrypoints=web"
- 'traefik.enable=true'
- 'traefik.http.routers.test-funkwhale-docs-web.rule=Host(`docs.funkwhale.test`)'
- 'traefik.http.routers.test-funkwhale-docs-web.entrypoints=web'
- "traefik.http.routers.test-funkwhale-docs-webs.rule=Host(`docs.funkwhale.test`)"
- "traefik.http.routers.test-funkwhale-docs-webs.entrypoints=webs"
- "traefik.http.routers.test-funkwhale-docs-webs.tls=true"
networks: ["web"]
- 'traefik.http.routers.test-funkwhale-docs-webs.rule=Host(`docs.funkwhale.test`)'
- 'traefik.http.routers.test-funkwhale-docs-webs.entrypoints=webs'
- 'traefik.http.routers.test-funkwhale-docs-webs.tls=true'
networks: ['web']

View File

@ -3,7 +3,7 @@ http:
test-funkwhale-mailpit:
loadbalancer:
servers:
- url: "http://172.17.0.1:8025"
- url: 'http://172.17.0.1:8025'
passhostheader: true
routers:
test-funkwhale-mailpit-web:

View File

@ -13,8 +13,8 @@ api:
entryPoints:
traefik:
address: "172.17.0.1:8008"
address: '172.17.0.1:8008'
web:
address: "172.17.0.1:80"
address: '172.17.0.1:80'
webs:
address: "172.17.0.1:443"
address: '172.17.0.1:443'

View File

@ -1,6 +1,6 @@
x-busybox: &busybox
init: true
image: "busybox"
image: 'busybox'
network_mode: bridge
dns: 172.17.0.1
dns_search: funkwhale.test
@ -11,18 +11,18 @@ networks:
services:
whoami:
image: "traefik/whoami"
image: 'traefik/whoami'
networks:
- web
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami-web.rule=Host(`whoami.funkwhale.test`)"
- "traefik.http.routers.whoami-web.entrypoints=web"
- 'traefik.enable=true'
- 'traefik.http.routers.whoami-web.rule=Host(`whoami.funkwhale.test`)'
- 'traefik.http.routers.whoami-web.entrypoints=web'
- "traefik.http.routers.whoami-webs.rule=Host(`whoami.funkwhale.test`)"
- "traefik.http.routers.whoami-webs.entrypoints=webs"
- "traefik.http.routers.whoami-webs.tls=true"
- "traefik.http.routers.whoami.tls.domains[0].main=whoami.funkwhale.test"
- 'traefik.http.routers.whoami-webs.rule=Host(`whoami.funkwhale.test`)'
- 'traefik.http.routers.whoami-webs.entrypoints=webs'
- 'traefik.http.routers.whoami-webs.tls=true'
- 'traefik.http.routers.whoami.tls.domains[0].main=whoami.funkwhale.test'
shell:
<<: *busybox

View File

@ -9,5 +9,5 @@ services:
MP_SMTP_BIND_ADDR: 172.17.0.1:1025
MP_MAX_MESSAGES: 5000
MP_DATABASE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: "true"
MP_SMTP_AUTH_ALLOW_INSECURE: "true"
MP_SMTP_AUTH_ACCEPT_ANY: 'true'
MP_SMTP_AUTH_ALLOW_INSECURE: 'true'

View File

@ -3,13 +3,13 @@ services:
image: minio/minio
command: server /data
volumes:
- "../.state/${COMPOSE_PROJECT_NAME:-funkwhale}/minio:/data"
- '../.state/${COMPOSE_PROJECT_NAME:-funkwhale}/minio:/data'
environment:
- "MINIO_ACCESS_KEY=${AWS_ACCESS_KEY_ID:-access_key}"
- "MINIO_SECRET_KEY=${AWS_SECRET_ACCESS_KEY:-secret_key}"
- "MINIO_HTTP_TRACE: /dev/stdout"
- 'MINIO_ACCESS_KEY=${AWS_ACCESS_KEY_ID:-access_key}'
- 'MINIO_SECRET_KEY=${AWS_SECRET_ACCESS_KEY:-secret_key}'
- 'MINIO_HTTP_TRACE: /dev/stdout'
ports:
- "9000:9000"
- '9000:9000'
networks:
- web
- internal

View File

@ -1,6 +1,6 @@
x-verify: &verify
init: true
image: "busybox"
image: 'busybox'
network_mode: bridge
dns: 172.17.0.1
dns_search: funkwhale.test
@ -12,4 +12,4 @@ services:
verify-internal-connectivity:
<<: *verify
command: "ping -c 1 ${COMPOSE_PROJECT_NAME:-funkwhale}.funkwhale.test"
command: 'ping -c 1 ${COMPOSE_PROJECT_NAME:-funkwhale}.funkwhale.test'

View File

@ -1,14 +1,19 @@
FROM node:18-alpine
FROM node:22-alpine
# needed to compile translations
RUN apk add --no-cache jq bash coreutils python3
RUN apk add --no-cache jq bash coreutils git python3
EXPOSE 8080
WORKDIR /app/
COPY scripts/ ./scripts/
# Create node_modules directory to prevent it from being hidden by volume mounts
RUN mkdir -p node_modules
ADD scripts/ ./scripts/
ADD package.json yarn.lock ./
RUN yarn install
RUN yarn
COPY . .
VOLUME /app
VOLUME /app/node_modules
EXPOSE 8080
CMD ["yarn", "serve"]
CMD ["yarn", "dev", "--host"]