all-in-one Docker Image

parent ac8553a5
Pipeline #1760 failed with stages
in 6 minutes and 25 seconds
......@@ -203,10 +203,10 @@ build_front:
name: "front_${CI_COMMIT_REF_NAME}"
paths:
- front/dist/
only:
- tags@funkwhale/funkwhale
- master@funkwhale/funkwhale
- develop@funkwhale/funkwhale
# only:
# - tags@funkwhale/funkwhale
# - master@funkwhale/funkwhale
# - develop@funkwhale/funkwhale
tags:
- docker
......@@ -250,6 +250,17 @@ docker_release:
tags:
- docker-build
docker_aio:
stage: deploy
before_script:
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- mkdir -p contrib/docker/root/opt/funkwhale
- cp -r front contrib/docker/root/opt/funkwhale
- cp -r api contrib/docker/root/opt/funkwhale
script:
- docker build -t docker.io/jcgruenhage/funkwhale:aio
- docker push docker.io/jcgruenhage/funkwhale:aio
build_api:
# Simply publish a zip containing api/ directory
stage: deploy
......
FUNKWHALE_URL=http://localhost
DATABASE_URL=postgresql://postgres@postgres:5432/postgres
CACHE_URL=redis://redis:6379/0
MEDIA_ROOT=/opt/funkwhale/data/media
STATIC_ROOT=/opt/funkwhale/data/static
DJANGO_ALLOWED_HOSTS=localhost
DJANGO_SETTINGS_MODULE=config.settings.production
DJANGO_SECRET_KEY=
DJANGO_ADMIN_URL=^api/admin/
LOGLEVEL=INFO
REVERSE_PROXY_TYPE=nginx
FROM docker.io/matrixdotorg/base-caddy
LABEL maintainer="Jan Christian Grünhage <jan.christian@gruenhage.xyz"
ENV UID=1337 \
GID=1337
COPY root /
RUN apk add --no-cache \
build-base \
python3-dev \
py3-pip \
git \
curl \
ffmpeg \
jpeg-dev \
file-dev \
postgresql-dev \
postgresql-client \
py3-pillow \
py3-tz \
py3-psycopg2 \
py3-redis \
youtube-dl \
py3-musicbrainzngs \
py3-markdown \
py3-raven \
py3-magic \
py3-cryptography \
su-exec \
s6 \
&& cd /opt/funkwhale \
&& pip3 install -r api/requirements.txt \
&& mkdir -p /opt/funkwhale/data/media \
&& mkdir -p /opt/funkwhale/front/dist/_protected \
&& ln -s /opt/funkwhale/data/media /opt/funkwhale/front/dist/_protected/media \
&& ln -s /opt/funkwhale/data/media /opt/funkwhale/front/dist/media \
&& ln -s /opt/funkwhale/data/static /opt/funkwhale/front/dist/staticfiles
CMD ["s6-svscan", "/etc/s6.d/"]
version: '2'
services:
funkwhale:
image: funkwhale
ports:
- 80:80
env_file: .env
links:
- postgres:postgres
- redis:redis
volumes:
- ./data:/opt/funkwhale/data
redis:
image: redis
postgres:
image: postgres
:80 {
root /opt/funkwhale/front/dist
internal /_protected/media
rewrite /rest/(.*) /api/subsonic/rest/{1}
proxy /api localhost:5000 {
transparent
}
proxy /federation localhost:5000 {
transparent
}
proxy /.well-known localhost:5000 {
transparent
}
log stdout
}
#!/bin/sh
exec su-exec ${UID}:${GID} caddy -conf /etc/caddy/Caddyfile
#!/bin/sh
cd /opt/funkwhale/api
chown -R ${UID}:${GID} ..
su-exec ${UID}:${GID} python3 manage.py migrate
su-exec ${UID}:${GID} python3 manage.py collectstatic --noinput
exec su-exec ${UID}:${GID} daphne -b 0.0.0.0 -p 5000 config.asgi:application --proxy-headers
#!/bin/sh
cd /opt/funkwhale/api
exec su-exec ${UID}:${GID} celery -A funkwhale_api.taskapp beat -l ${LOGLEVEL}
#!/bin/sh
cd /opt/funkwhale/api
exec su-exec ${UID}:${GID} celery -A funkwhale_api.taskapp worker -l ${LOGLEVEL}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment