Spaces:
Sleeping
Sleeping
Add dataset folder structure
Browse files- .gitignore +9 -2
- Dockerfile +6 -17
- dataset/audio/.gitkeep +1 -0
- dataset/fonts/.gitkeep +1 -0
- dataset/metadata/.gitkeep +1 -0
- dataset/transcriptions/.gitkeep +1 -0
- next.config.ts +0 -11
.gitignore
CHANGED
|
@@ -40,5 +40,12 @@ yarn-error.log*
|
|
| 40 |
*.tsbuildinfo
|
| 41 |
next-env.d.ts
|
| 42 |
|
| 43 |
-
# Dataset
|
| 44 |
-
/dataset/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
*.tsbuildinfo
|
| 41 |
next-env.d.ts
|
| 42 |
|
| 43 |
+
# Dataset user data (ignore files, keep folder structure)
|
| 44 |
+
/dataset/audio/*
|
| 45 |
+
!/dataset/audio/.gitkeep
|
| 46 |
+
/dataset/transcriptions/*
|
| 47 |
+
!/dataset/transcriptions/.gitkeep
|
| 48 |
+
/dataset/metadata/*
|
| 49 |
+
!/dataset/metadata/.gitkeep
|
| 50 |
+
/dataset/fonts/*
|
| 51 |
+
!/dataset/fonts/.gitkeep
|
Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
FROM node:
|
| 2 |
|
| 3 |
# Install dependencies only when needed
|
| 4 |
FROM base AS deps
|
|
@@ -29,37 +29,26 @@ WORKDIR /app
|
|
| 29 |
ENV NODE_ENV=production
|
| 30 |
ENV NEXT_TELEMETRY_DISABLED=1
|
| 31 |
|
| 32 |
-
# Create a non-root user with UID 1000 (required for HF Spaces)
|
| 33 |
-
RUN addgroup --system --gid 1001 nodejs
|
| 34 |
-
RUN adduser --system --uid 1000 nextjs
|
| 35 |
-
|
| 36 |
# Copy public folder
|
| 37 |
COPY --from=builder /app/public ./public
|
| 38 |
|
| 39 |
# Copy built application
|
| 40 |
-
COPY --from=builder
|
| 41 |
-
COPY --from=builder
|
| 42 |
|
| 43 |
# Create /data directory for HF Spaces persistent storage
|
| 44 |
-
# This directory is mounted at runtime on HF Spaces
|
| 45 |
RUN mkdir -p /data && chmod 777 /data
|
| 46 |
|
| 47 |
-
# Create local dataset directory as fallback
|
| 48 |
-
RUN mkdir -p /app/dataset &&
|
| 49 |
|
| 50 |
-
# Set default data directory
|
| 51 |
ENV DATA_DIR=/data
|
| 52 |
|
| 53 |
-
USER nextjs
|
| 54 |
-
|
| 55 |
# HF Spaces uses port 7860 by default
|
| 56 |
EXPOSE 7860
|
| 57 |
|
| 58 |
ENV PORT=7860
|
| 59 |
ENV HOSTNAME="0.0.0.0"
|
| 60 |
|
| 61 |
-
# Health check for container monitoring
|
| 62 |
-
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 63 |
-
CMD wget --no-verbose --tries=1 --spider http://localhost:7860/ || exit 1
|
| 64 |
-
|
| 65 |
CMD ["node", "server.js"]
|
|
|
|
| 1 |
+
FROM node:20-alpine AS base
|
| 2 |
|
| 3 |
# Install dependencies only when needed
|
| 4 |
FROM base AS deps
|
|
|
|
| 29 |
ENV NODE_ENV=production
|
| 30 |
ENV NEXT_TELEMETRY_DISABLED=1
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# Copy public folder
|
| 33 |
COPY --from=builder /app/public ./public
|
| 34 |
|
| 35 |
# Copy built application
|
| 36 |
+
COPY --from=builder /app/.next/standalone ./
|
| 37 |
+
COPY --from=builder /app/.next/static ./.next/static
|
| 38 |
|
| 39 |
# Create /data directory for HF Spaces persistent storage
|
|
|
|
| 40 |
RUN mkdir -p /data && chmod 777 /data
|
| 41 |
|
| 42 |
+
# Create local dataset directory as fallback
|
| 43 |
+
RUN mkdir -p /app/dataset && chmod 777 /app/dataset
|
| 44 |
|
| 45 |
+
# Set default data directory
|
| 46 |
ENV DATA_DIR=/data
|
| 47 |
|
|
|
|
|
|
|
| 48 |
# HF Spaces uses port 7860 by default
|
| 49 |
EXPOSE 7860
|
| 50 |
|
| 51 |
ENV PORT=7860
|
| 52 |
ENV HOSTNAME="0.0.0.0"
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
CMD ["node", "server.js"]
|
dataset/audio/.gitkeep
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# This file keeps the directory in git
|
dataset/fonts/.gitkeep
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# This file keeps the directory in git
|
dataset/metadata/.gitkeep
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# This file keeps the directory in git
|
dataset/transcriptions/.gitkeep
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# This file keeps the directory in git
|
next.config.ts
CHANGED
|
@@ -2,17 +2,6 @@ import type { NextConfig } from "next";
|
|
| 2 |
|
| 3 |
const nextConfig: NextConfig = {
|
| 4 |
output: 'standalone',
|
| 5 |
-
env: {
|
| 6 |
-
DATA_DIR: process.env.DATA_DIR || '',
|
| 7 |
-
},
|
| 8 |
-
// Ensure server-side code can access environment variables
|
| 9 |
-
serverRuntimeConfig: {
|
| 10 |
-
DATA_DIR: process.env.DATA_DIR || '',
|
| 11 |
-
},
|
| 12 |
-
// Enable instrumentation for cleanup scheduler
|
| 13 |
-
experimental: {
|
| 14 |
-
instrumentationHook: true,
|
| 15 |
-
},
|
| 16 |
};
|
| 17 |
|
| 18 |
export default nextConfig;
|
|
|
|
| 2 |
|
| 3 |
const nextConfig: NextConfig = {
|
| 4 |
output: 'standalone',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
};
|
| 6 |
|
| 7 |
export default nextConfig;
|