bug fixes from sxsw
This commit is contained in:
56
apps/indeedhub/Dockerfile
Normal file
56
apps/indeedhub/Dockerfile
Normal file
@@ -0,0 +1,56 @@
|
||||
# Multi-stage Dockerfile for Indeehub Frontend (Next.js)
|
||||
# Build: podman build -t localhost/indeedhub:latest -f apps/indeedhub/Dockerfile /path/to/indeehub-frontend
|
||||
# Run: podman run -d --name indeedhub -p 8190:3000 localhost/indeedhub:latest
|
||||
|
||||
# ── Stage 1: Dependencies ──
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm ci --ignore-scripts
|
||||
|
||||
# ── Stage 2: Build ──
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Inject standalone output mode for containerized deployment
|
||||
RUN sed -i 's/reactStrictMode: true,/reactStrictMode: true, output: "standalone",/' next.config.js
|
||||
|
||||
# Build-time environment — connects to Indeehub production services
|
||||
ENV NEXT_PUBLIC_APP_ENVIRONMENT=production
|
||||
ENV NEXT_PUBLIC_APP_URL=http://localhost:8190
|
||||
ENV NEXT_PUBLIC_API_URL=https://api.indeehub.studio
|
||||
ENV NEXT_PUBLIC_S3_PRIVATE_BUCKET=indeehub-private
|
||||
ENV NEXT_PUBLIC_S3_PUBLIC_BUCKET=indeehub-public
|
||||
ENV NEXT_PUBLIC_ENABLE_APPROVAL_FLOW=false
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Remove shaka-player .d.ts files that break the build (per package.json build script)
|
||||
RUN rm -f ./node_modules/shaka-player/dist/*.d.ts
|
||||
RUN npm run build
|
||||
|
||||
# ── Stage 3: Runner ──
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs && \
|
||||
adduser --system --uid 1001 nextjs
|
||||
|
||||
# Copy standalone build output
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 --start-period=40s \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
@@ -1,44 +1,53 @@
|
||||
# IndeedHub (Indeehub Prototype)
|
||||
# Indeehub — Bitcoin Documentary Streaming
|
||||
|
||||
Bitcoin documentary streaming platform featuring God Bless Bitcoin and other educational content about Bitcoin, sovereignty, and decentralized technology.
|
||||
|
||||
Self-hosted Next.js app with Nostr identity sign-in via Archipelago's NIP-07 provider.
|
||||
|
||||
## Building the Image
|
||||
|
||||
The app image is built from the **Indeehub Prototype** project. The prototype lives at `../../Indeedhub Prototype` (relative to the archy repo).
|
||||
The app image is built from the **indeehub-frontend** project at `~/Projects/indeehub-frontend`.
|
||||
|
||||
### Option 1: Build from prototype directory
|
||||
|
||||
```bash
|
||||
cd "/path/to/Indeedhub Prototype"
|
||||
podman build -t localhost/indeedhub:latest .
|
||||
```
|
||||
|
||||
### Option 2: Use the build script
|
||||
### Option 1: Use the build script
|
||||
|
||||
```bash
|
||||
# From archy repo root
|
||||
./apps/indeedhub/build-from-prototype.sh
|
||||
```
|
||||
|
||||
### Option 3: Full deploy (build + run on server)
|
||||
### Option 2: Build from source directory
|
||||
|
||||
```bash
|
||||
cd "/path/to/Indeedhub Prototype"
|
||||
./deploy-to-archipelago.sh
|
||||
cd ~/Projects/indeehub-frontend
|
||||
podman build -t localhost/indeedhub:latest -f ~/Projects/archy/apps/indeedhub/Dockerfile .
|
||||
```
|
||||
|
||||
## Installing from My Apps
|
||||
## Installing from App Store
|
||||
|
||||
1. **Build the image** using one of the options above (the image must exist before install)
|
||||
2. Go to **Dashboard → App Store** (Marketplace)
|
||||
3. Find **Indeehub Prototype** and click **Install**
|
||||
4. The app will appear in **My Apps** once the container is running
|
||||
1. **Build the image** using one of the options above (must exist before install)
|
||||
2. Go to **Dashboard -> App Store** (Marketplace)
|
||||
3. Find **Indeehub** and click **Install**
|
||||
4. On first launch, pick a Nostr identity to sign in with
|
||||
5. The app appears in **My Apps** once the container is running
|
||||
|
||||
## Port
|
||||
|
||||
- Web UI: 7777
|
||||
- Web UI: 8190 (maps to container port 3000)
|
||||
|
||||
## Container
|
||||
|
||||
- Image: `localhost/indeedhub:latest` (built locally, not pulled from a registry)
|
||||
- Port: 7777
|
||||
- Runtime: Node.js 20 (Next.js standalone)
|
||||
- Port: 8190 -> 3000
|
||||
- Read-only root filesystem with tmpfs for /tmp and .next/cache
|
||||
|
||||
## Nostr Identity
|
||||
|
||||
On first launch, Archipelago shows a cypherpunk identity picker modal. Select which of your identities to use for NIP-07 signing. The NIP-07 provider is injected automatically via nginx proxy.
|
||||
|
||||
## Services
|
||||
|
||||
The app connects to the following external services (configured at build time):
|
||||
- Indeehub API (content, auth, streaming)
|
||||
- AWS S3 (media storage via CloudFront CDN)
|
||||
- Nostr relays (via NIP-07 provider from Archipelago)
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Build Indeehub image from the Indeehub Prototype project
|
||||
# Usage: ./build-from-prototype.sh [path-to-prototype]
|
||||
# Build Indeehub container image from the indeehub-frontend project
|
||||
# Usage: ./build-from-prototype.sh [path-to-indeehub-frontend]
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEFAULT_PROTOTYPE="$SCRIPT_DIR/../../Indeedhub Prototype"
|
||||
PROTOTYPE_DIR="${1:-$DEFAULT_PROTOTYPE}"
|
||||
DEFAULT_FRONTEND="$HOME/Projects/indeehub-frontend"
|
||||
FRONTEND_DIR="${1:-$DEFAULT_FRONTEND}"
|
||||
IMAGE_TAG="localhost/indeedhub:latest"
|
||||
|
||||
if [ ! -d "$PROTOTYPE_DIR" ]; then
|
||||
echo "❌ Indeehub Prototype not found at: $PROTOTYPE_DIR"
|
||||
echo " Set path: $0 /path/to/Indeedhub\ Prototype"
|
||||
if [ ! -d "$FRONTEND_DIR" ]; then
|
||||
echo "Indeehub frontend not found at: $FRONTEND_DIR"
|
||||
echo " Set path: $0 /path/to/indeehub-frontend"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$FRONTEND_DIR/package.json" ]; then
|
||||
echo "No package.json found in $FRONTEND_DIR — is this the right directory?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -21,10 +26,10 @@ if ! command -v podman >/dev/null 2>&1; then
|
||||
RUNTIME="docker"
|
||||
fi
|
||||
|
||||
echo "🔨 Building Indeehub from $PROTOTYPE_DIR"
|
||||
cd "$PROTOTYPE_DIR"
|
||||
$RUNTIME build -t "$IMAGE_TAG" .
|
||||
echo "Building Indeehub from $FRONTEND_DIR using $SCRIPT_DIR/Dockerfile"
|
||||
$RUNTIME build -t "$IMAGE_TAG" -f "$SCRIPT_DIR/Dockerfile" "$FRONTEND_DIR"
|
||||
|
||||
echo "✅ Built $IMAGE_TAG"
|
||||
echo "Built $IMAGE_TAG"
|
||||
echo ""
|
||||
echo "You can now install Indeehub from the App Store in Archipelago."
|
||||
echo "Or run directly: $RUNTIME run -d --name indeedhub -p 8190:3000 $IMAGE_TAG"
|
||||
|
||||
@@ -2,62 +2,62 @@ app:
|
||||
id: indeedhub
|
||||
name: Indeehub
|
||||
version: 0.1.0
|
||||
description: Bitcoin documentary streaming platform featuring God Bless Bitcoin and other educational content about Bitcoin, sovereignty, and decentralized technology.
|
||||
description: Bitcoin documentary streaming platform featuring God Bless Bitcoin and other educational content about Bitcoin, sovereignty, and decentralized technology. Sign in with your Nostr identity.
|
||||
category: media
|
||||
|
||||
|
||||
container:
|
||||
image: localhost/indeedhub:1.0.0
|
||||
pull_policy: never # Built locally
|
||||
|
||||
image: git.tx1138.com/lfg2025/indeedhub:latest
|
||||
pull_policy: always # Pull from registry; falls back to local build
|
||||
|
||||
dependencies:
|
||||
- storage: 500Mi
|
||||
|
||||
- storage: 1Gi
|
||||
|
||||
resources:
|
||||
cpu_limit: 1
|
||||
cpu_limit: 2
|
||||
memory_limit: 512Mi
|
||||
disk_limit: 500Mi
|
||||
|
||||
disk_limit: 1Gi
|
||||
|
||||
security:
|
||||
capabilities: []
|
||||
readonly_root: true # Static nginx content
|
||||
readonly_root: true
|
||||
no_new_privileges: true
|
||||
user: 1000
|
||||
user: 1001
|
||||
seccomp_profile: default
|
||||
network_policy: bridge
|
||||
apparmor_profile: default
|
||||
|
||||
|
||||
ports:
|
||||
- host: 7777
|
||||
container: 7777
|
||||
protocol: tcp # Web UI
|
||||
|
||||
- host: 8190
|
||||
container: 3000
|
||||
protocol: tcp # Web UI (Next.js)
|
||||
|
||||
volumes:
|
||||
- type: tmpfs
|
||||
target: /var/cache/nginx
|
||||
options: [rw,noexec,nosuid,size=10m]
|
||||
target: /tmp
|
||||
options: [rw,noexec,nosuid,size=64m]
|
||||
- type: tmpfs
|
||||
target: /var/run
|
||||
options: [rw,noexec,nosuid,size=10m]
|
||||
|
||||
target: /app/.next/cache
|
||||
options: [rw,noexec,nosuid,size=128m]
|
||||
|
||||
environment:
|
||||
- NGINX_HOST=localhost
|
||||
- NGINX_PORT=7777
|
||||
|
||||
- NODE_ENV=production
|
||||
- NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
health_check:
|
||||
type: http
|
||||
endpoint: http://localhost:7777
|
||||
path: /health
|
||||
endpoint: http://localhost:3000
|
||||
path: /
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
|
||||
interfaces:
|
||||
main:
|
||||
name: Web UI
|
||||
description: Stream Bitcoin documentaries
|
||||
description: Stream Bitcoin documentaries with Nostr identity
|
||||
type: ui
|
||||
port: 7777
|
||||
port: 8190
|
||||
protocol: http
|
||||
path: /
|
||||
|
||||
@@ -72,3 +72,4 @@ app:
|
||||
- streaming
|
||||
- media
|
||||
- education
|
||||
- nostr
|
||||
|
||||
70
apps/indeedhub/push-to-registry.sh
Executable file
70
apps/indeedhub/push-to-registry.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
# Build and push Indeehub container image to a registry
|
||||
# Usage: ./push-to-registry.sh [version]
|
||||
#
|
||||
# Environment variables:
|
||||
# REGISTRY - Registry host (default: ghcr.io)
|
||||
# NAMESPACE - Registry namespace (default: archipelago-os)
|
||||
# RUNTIME - Container runtime (default: podman)
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
FRONTEND_DIR="${INDEEHUB_FRONTEND:-$HOME/Projects/indeehub-frontend}"
|
||||
VERSION="${1:-latest}"
|
||||
REGISTRY="${REGISTRY:-git.tx1138.com}"
|
||||
NAMESPACE="${NAMESPACE:-lfg2025}"
|
||||
IMAGE_NAME="indeedhub"
|
||||
RUNTIME="${RUNTIME:-podman}"
|
||||
|
||||
FULL_TAG="${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:${VERSION}"
|
||||
LATEST_TAG="${REGISTRY}/${NAMESPACE}/${IMAGE_NAME}:latest"
|
||||
|
||||
if [ ! -d "$FRONTEND_DIR" ]; then
|
||||
echo "Indeehub frontend not found at: $FRONTEND_DIR"
|
||||
echo "Set INDEEHUB_FRONTEND=/path/to/indeehub-frontend"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== Indeehub Container Registry Push ==="
|
||||
echo "Source: $FRONTEND_DIR"
|
||||
echo "Image: $FULL_TAG"
|
||||
echo "Runtime: $RUNTIME"
|
||||
echo ""
|
||||
|
||||
# Step 1: Build for linux/amd64 (target architecture)
|
||||
echo "[1/3] Building image..."
|
||||
$RUNTIME build --platform linux/amd64 \
|
||||
-t "$FULL_TAG" \
|
||||
-t "$LATEST_TAG" \
|
||||
-t "localhost/${IMAGE_NAME}:latest" \
|
||||
-t "localhost/${IMAGE_NAME}:${VERSION}" \
|
||||
-f "$SCRIPT_DIR/Dockerfile" \
|
||||
"$FRONTEND_DIR"
|
||||
|
||||
echo "[2/3] Pushing to registry..."
|
||||
# Login check
|
||||
if ! $RUNTIME login --get-login "$REGISTRY" >/dev/null 2>&1; then
|
||||
echo ""
|
||||
echo "Not logged in to $REGISTRY."
|
||||
echo "Run: $RUNTIME login $REGISTRY"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$RUNTIME push "$FULL_TAG"
|
||||
if [ "$VERSION" != "latest" ]; then
|
||||
$RUNTIME push "$LATEST_TAG"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "[3/3] Done!"
|
||||
echo ""
|
||||
echo "Image pushed: $FULL_TAG"
|
||||
if [ "$VERSION" != "latest" ]; then
|
||||
echo "Also tagged: $LATEST_TAG"
|
||||
fi
|
||||
echo ""
|
||||
echo "Federated nodes can now install via:"
|
||||
echo " podman pull $FULL_TAG"
|
||||
echo ""
|
||||
echo "Update marketplace dockerImage to: $FULL_TAG"
|
||||
Reference in New Issue
Block a user