Refactor Docker setup for minimal image and update build scripts; adjust static asset serving in production
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m0s

This commit is contained in:
Cameron Redmore 2025-08-08 17:02:32 +01:00
parent 363e1540e0
commit 20d6a8d577
No known key found for this signature in database
6 changed files with 47 additions and 21 deletions

View file

@ -1,5 +1,6 @@
import { Elysia, t } from 'elysia';
import { staticPlugin } from '@elysiajs/static';
import path from 'path';
// Song data interface
interface LastSong {
@ -87,9 +88,16 @@ setInterval(checkAndUpdateSong, 1000);
// Initial fetch
checkAndUpdateSong();
// Determine static assets path - adjust for compiled executable
const assetsPath = process.env.NODE_ENV === 'production'
? path.join(path.dirname(process.execPath || __dirname), 'dist')
: 'dist';
console.log('Serving static assets from:', assetsPath);
const app = new Elysia()
.use(staticPlugin({
assets: 'dist',
assets: assetsPath,
prefix: ''
}))
.ws('/music', {