added docker

This commit is contained in:
2025-09-03 19:45:48 +02:00
parent 4cbf97cc5a
commit b567187a77
4 changed files with 67 additions and 0 deletions

14
.dockerignore Normal file
View File

@@ -0,0 +1,14 @@
node_modules
npm-debug.log*
.DS_Store
.git
.gitignore
tmp_*.json
tmp*
data/*
!data/years.json
*.mp3
*.wav
*.m4a
*.ogg
*.flac

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
# Lightweight production image for the Hitstar Node app
FROM node:22-alpine
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci --omit=dev || npm install --omit=dev
# Copy app source (media lives outside via volume)
COPY . .
ENV NODE_ENV=production \
PORT=5173
EXPOSE 5173
CMD ["node", "server.js"]

View File

@@ -1,5 +1,27 @@
# Hitstar lokale Web-App (Prototyp)
## Docker
Run the app in a container while using your local `data/` music folder:
1) Build the image
```powershell
docker compose build
```
2) Start the service
```powershell
docker compose up -d
```
3) Open http://localhost:5173
Notes:
- Your local `data/` is mounted read/write at `/app/data` inside the container, so you can manage tracks on the host.
- To rebuild after changes: `docker compose build --no-cache && docker compose up -d`.
Lokales Multiplayer-Webspiel inspiriert von HITSTER. Nutzt eure MP3-Dateien im Ordner `data/`, eine Lobby mit Raum-Code sowie WebSockets für den Mehrspieler-Modus.
## Features

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
services:
hitstar:
build: .
image: hitstar-webapp:latest
container_name: hitstar
environment:
- NODE_ENV=production
- PORT=5173
ports:
- "5173:5173"
volumes:
- ./data:/app/data:rw
restart: unless-stopped