Skip to content
Merged

Done #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules
.next
.git
.env
.env.local
.env*.local
*.db
*.db-journal
stripe_destinations_cache.json
Dockerfile
.dockerignore
README.md
walkthrough.md
5 changes: 2 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
# Use any 32-byte hex key for testnet: `openssl rand -hex 32`, prefixed 0x.
T3N_AGENT_PRIVATE_KEY=0x...

# Prisma + SQLite. Also add this to a root .env file so the Prisma CLI
# (db push / seed / studio) can read it. Path is relative to prisma/schema.prisma.
DATABASE_URL="file:./dev.db"
# Prisma + PostgreSQL. Copy to .env.local/root .env and replace with your Neon database URL.
DATABASE_URL="postgresql://neondb_owner:password@localhost:5432/neondb?sslmode=disable"

# Demo BUYER signer (Step 3). In production the buyer signs the delegation
# credential in their own wallet; this key stands in for the demo. SERVER-ONLY.
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ jobs:
verify:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_DB: neondb
POSTGRES_USER: neondb_owner
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
DATABASE_URL: "postgresql://neondb_owner:password@localhost:5432/neondb?sslmode=disable"

steps:
- uses: actions/checkout@v4

Expand Down
35 changes: 0 additions & 35 deletions BUGS.md

This file was deleted.

88 changes: 0 additions & 88 deletions DEMO.md

This file was deleted.

41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM node:20-alpine

# Install openssl and curl (useful for health checks)
RUN apk add --no-cache openssl curl

WORKDIR /app

# Copy dependency configs
COPY package*.json ./
COPY tsconfig.json ./
COPY next.config.mjs ./
COPY postcss.config.mjs ./
COPY tailwind.config.ts ./

# Copy database schema
COPY prisma ./prisma/

# Install all dependencies (development & production)
RUN npm ci

# Copy the rest of the application code
COPY app ./app/
COPY lib ./lib/
COPY tools ./tools/
COPY images ./images/

# Generate Prisma Client & Build the application for production
RUN npx prisma generate
RUN npm run build

# Expose Next.js port
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"

# Setup runtime entrypoint script to automatically push schema, seed, and run
RUN echo '#!/bin/sh' > /app/start.sh && \
echo 'npx prisma db push --accept-data-loss && npx prisma db seed && npm run start' >> /app/start.sh && \
chmod +x /app/start.sh

CMD ["/app/start.sh"]
Loading
Loading