Switch to esbuild for running HPNP.
This commit is contained in:
parent
f2dd535691
commit
59055ef31f
20
Dockerfile
20
Dockerfile
|
@ -63,7 +63,18 @@ RUN bash /bd_build/chown_dirs.sh \
|
|||
|
||||
USER azuracast
|
||||
|
||||
RUN touch /var/azuracast/.docker
|
||||
# Build HPNP
|
||||
RUN mkdir -p /tmp/hpnp
|
||||
|
||||
COPY --chown=azuracast:azuracast ./frontend /tmp/hpnp
|
||||
|
||||
RUN cd /tmp/hpnp \
|
||||
&& npm ci --include=dev \
|
||||
&& npm run build-hpnp \
|
||||
&& chmod a+x /var/azuracast/scripts/hpnp.cjs
|
||||
|
||||
RUN rm -rf /tmp/hpnp \
|
||||
&& touch /var/azuracast/.docker
|
||||
|
||||
USER root
|
||||
|
||||
|
@ -162,13 +173,6 @@ RUN composer dump-autoload --optimize --classmap-authoritative
|
|||
|
||||
USER root
|
||||
|
||||
COPY ./util/docker/common /bd_build/
|
||||
COPY ./util/docker/hpnp /bd_build/hpnp
|
||||
|
||||
RUN bash /bd_build/hpnp/setup.sh \
|
||||
&& bash /bd_build/cleanup.sh \
|
||||
&& rm -rf /bd_build
|
||||
|
||||
EXPOSE 80 443 2022
|
||||
EXPOSE 8000-8999
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
"serve": "vite",
|
||||
"generate-locales": "vue-gettext-extract",
|
||||
"generate-api": "swagger-typescript-api --path http://localhost/api/openapi.yml --output ./src/entities --name ApiInterfaces.ts --no-client",
|
||||
"hpnp-dev": "bun --hot ./src/hpnp/index.ts",
|
||||
"build-hpnp": "bun build --compile --minify --outfile ./hpnp ./src/hpnp/index.ts"
|
||||
"build-hpnp": "esbuild --bundle --target=node20 --platform=node ./src/hpnp/index.ts > /var/azuracast/scripts/hpnp.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/lang-css": "^6.0.1",
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import {ApiNowPlaying} from "~/entities/ApiInterfaces.ts";
|
||||
import {Channel, createChannel, createSession, Session} from "better-sse";
|
||||
import {App} from '@tinyhttp/app';
|
||||
|
|
|
@ -14,6 +14,7 @@ usermod -aG www-data azuracast
|
|||
mkdir -p /var/azuracast/www /var/azuracast/stations /var/azuracast/www_tmp \
|
||||
/var/azuracast/backups \
|
||||
/var/azuracast/dbip \
|
||||
/var/azuracast/scripts \
|
||||
/var/azuracast/storage/uploads \
|
||||
/var/azuracast/storage/shoutcast2 \
|
||||
/var/azuracast/storage/stereo_tool \
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
curl -fsSL https://bun.sh/install | gosu azuracast bash
|
||||
|
||||
ln -s /var/azuracast/.bun/bin/bun /usr/local/bin/bun
|
||||
ln -s /var/azuracast/.bun/bin/bunx /usr/local/bin/bunx
|
|
@ -1,19 +0,0 @@
|
|||
[program:hpnp]
|
||||
directory=/var/azuracast/
|
||||
command=hpnp
|
||||
user=azuracast
|
||||
priority=700
|
||||
numprocs=1
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
stopasgroup=true
|
||||
killasgroup=true
|
||||
|
||||
stdout_logfile=/var/azuracast/www_tmp/service_hpnp.log
|
||||
stdout_logfile_maxbytes=5MB
|
||||
stdout_logfile_backups=5
|
||||
redirect_stderr=true
|
||||
|
||||
stdout_events_enabled = true
|
||||
stderr_events_enabled = true
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
curl -fsSL https://bun.sh/install | gosu azuracast bash
|
||||
ln -s /var/azuracast/.bun/bin/bun /usr/local/bin/bun
|
||||
ln -s /var/azuracast/.bun/bin/bunx /usr/local/bin/bunx
|
||||
|
||||
cd /var/azuracast/www/frontend
|
||||
gosu azuracast npm ci
|
||||
gosu azuracast npm run build-hpnp
|
||||
|
||||
mv ./hpnp /usr/local/bin/hpnp
|
||||
chmod a+x /usr/local/bin/hpnp
|
||||
|
||||
rm -rf /var/azuracast/www/frontend/node_modules
|
||||
rm -rf /var/azuracast/.bun
|
||||
rm -rf /usr/local/bin/bun
|
||||
rm -rf /usr/local/bin/bunx
|
||||
|
||||
cp -rT /bd_build/hpnp/service.full/. /etc/supervisor/full.conf.d/
|
|
@ -1,6 +1,6 @@
|
|||
[program:hpnp]
|
||||
directory=/var/azuracast/www/frontend
|
||||
command=npm run hpnp-dev
|
||||
directory=/var/azuracast/scripts
|
||||
command=/var/azuracast/scripts/hpnp.cjs
|
||||
user=azuracast
|
||||
priority=700
|
||||
numprocs=1
|
Loading…
Reference in New Issue