diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..d91bddd351155d4338a2f6d245378d11798a680f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +apps/*/node_modules +.git +uploads +*.local +.pnpm-store +**/.next diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b0e7b890734820f25c182b9c45fb166eeaa9960e --- /dev/null +++ b/.gitignore @@ -0,0 +1,66 @@ +# === personal === +deploy.sh +uploads/* + +# Dependencies +node_modules +.pnp +.pnp.js +.pnpm-store/ + +# Testing +coverage +.nyc_output + +# Build outputs +dist +build +.next +out +.nuxt +.output +.cache +.turbo + +# Environment variables +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Debug logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +# Editor directories and files +.idea +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +.DS_Store +*.pem + +# Vercel +.vercel + +# TypeScript +*.tsbuildinfo +next-env.d.ts + +# Redis +dump.rdb +*.rdb + +# Misc +.DS_Store +*.pem +.eslintcache diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b77fea91e7fdab84ba990b76216035c782439ed5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM node:20-bookworm + +# Install runtime dependencies for the Space: nginx for proxying websockets and redis-server for storage +RUN apt-get update \ + && apt-get install -y --no-install-recommends nginx redis-server gettext-base \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# Enable pnpm +ENV PNPM_HOME=/root/.local/share/pnpm +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable && corepack prepare pnpm@10.11.0 --activate + +# Copy manifests first for better caching +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY apps/backend/package.json apps/backend/pnpm-lock.yaml ./apps/backend/ +COPY apps/frontend/package.json apps/frontend/pnpm-lock.yaml ./apps/frontend/ + +# Install dependencies for all workspaces +RUN pnpm install --frozen-lockfile + +# Copy the rest of the source +COPY . . + +# Build the applications with sensible defaults for local communication +ENV NODE_ENV=production \ + DOCKER_BACKEND_URL=http://127.0.0.1:3001 \ + NEXT_PUBLIC_URL=http://127.0.0.1:7860 \ + PUBLIC_SOCKET_URL= + +RUN pnpm --filter @myclipboard.online/backend build \ + && pnpm --filter @myclipboard.online/frontend build + +# Clean up nginx defaults +RUN rm -f /etc/nginx/sites-enabled/default /etc/nginx/sites-available/default || true + +EXPOSE 7860 + +CMD ["bash", "deploy/hf/start.sh"] diff --git a/README.md b/README.md index a3e2e69561d97b2a14b1c21f8ae9e013dd73722e..7957ba94b440679c31e8c5986bfb62230869e4b6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,75 @@ ---- -title: Clip -emoji: 👀 -colorFrom: indigo -colorTo: purple -sdk: docker -pinned: false ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +# MyClipboard.online + +
+
+
No entries yet
+Add your first entry using the form above
+No files yet
+Upload your first file using the form above
+{file.filename}
++ {formatFileSize(file.size)} • {new Date(file.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} +
+This action cannot be undone.
+