Add Docker support with Dockerfile, docker-compose, and deployment documentation

This commit is contained in:
2025-12-07 23:47:07 +00:00
parent 4f954d9b15
commit 2ca35620d9
5 changed files with 244 additions and 0 deletions

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# Use Node.js LTS
FROM node:20-alpine
# Install dependencies for native modules
RUN apk add --no-cache python3 make g++
# Create app directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy application code
COPY . .
# Create directories for data
RUN mkdir -p /data/artwork /data/music
# Expose port
EXPOSE 4000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:4000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start the server
CMD ["npm", "start"]