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
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m0s
This commit is contained in:
parent
363e1540e0
commit
20d6a8d577
6 changed files with 47 additions and 21 deletions
|
@ -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', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue