diff --git a/Dockerfile b/Dockerfile index c132ad5..3b36a91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,16 +15,15 @@ ARG VERSION=2.3.0 RUN curl -sL https://github.com/Chocobozzz/PeerTube/releases/download/v${VERSION}/peertube-v${VERSION}.tar.xz | tar --strip-components 1 -Jxvf - RUN yarn install --production --pure-lockfile -# remove the peertube suffix of dbname (see https://github.com/Chocobozzz/PeerTube/pull/2898) -RUN sed -e "s/DBNAME: 'peertube' +/DBNAME: /g" -i dist/server/initializers/config.js - # dbname branch # ARG VERSION=e7fe135b5a5666147256efa11d15474d761c37d4 # RUN curl -L https://github.com/cloudron-io/PeerTube/archive/${VERSION}.tar.gz | tar -zxvf - --strip-components=1 # # RUN yarn install && npm run build -RUN ln -sf /app/data/production.yaml /app/code/config/local-production.yaml +# the json is created and managed by web ui. it overrides the yaml file +RUN ln -sf /app/data/production.yaml /app/code/config/local-production.yaml && \ + ln -sf /app/data/local-production.json /app/code/config/local-production.json COPY production.yaml.example start.sh /app/pkg/ diff --git a/production.yaml.example b/production.yaml.example index 9f9977b..ab58a92 100644 --- a/production.yaml.example +++ b/production.yaml.example @@ -33,11 +33,10 @@ trust_proxy: - 172.18.0.0/16 - 'loopback' -# Your database name will be "peertube"+database.suffix database: hostname: 'localhost' + name: 'dbname' port: 5432 - suffix: '_prod' username: 'peertube' password: 'peertube' pool: @@ -87,6 +86,7 @@ storage: captions: '/var/www/peertube/storage/captions/' cache: '/var/www/peertube/storage/cache/' plugins: '/var/www/peertube/storage/plugins/' + client_overrides: '/var/www/peertube/storage/client-overrides/' log: level: 'info' # debug/info/warning/error diff --git a/start.sh b/start.sh index 9bf09f6..39f09e9 100755 --- a/start.sh +++ b/start.sh @@ -34,7 +34,7 @@ yq w -i /app/data/production.yaml database.hostname "${CLOUDRON_POSTGRESQL_HOST} yq w -i /app/data/production.yaml database.port "${CLOUDRON_POSTGRESQL_PORT}" yq w -i /app/data/production.yaml database.username "${CLOUDRON_POSTGRESQL_USERNAME}" yq w -i /app/data/production.yaml database.password "${CLOUDRON_POSTGRESQL_PASSWORD}" -yq w -i /app/data/production.yaml database.suffix "${CLOUDRON_POSTGRESQL_DATABASE}" +yq w -i /app/data/production.yaml database.name "${CLOUDRON_POSTGRESQL_DATABASE}" # redis yq w -i /app/data/production.yaml redis.hostname "${CLOUDRON_REDIS_HOST}" @@ -52,5 +52,6 @@ yq w -i /app/data/production.yaml smtp.from_address "${CLOUDRON_MAIL_FROM}" chown -R cloudron:cloudron /app/data +echo "==> Starting PeerTube" exec gosu cloudron:cloudron npm start