From f046f2bc48171e1c0a0fb6a5dd0fd06280616b99 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 7 Feb 2026 14:14:29 +0100 Subject: [PATCH] Add deployment scaffolding (Dockerfile, docker-compose, nginx) Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 16 ++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f9862ec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM node:20-alpine AS builder + +# Install pnpm +RUN corepack enable && corepack prepare pnpm@latest --activate + +WORKDIR /app +COPY package.json pnpm-lock.yaml ./ +RUN pnpm install --frozen-lockfile + +COPY . . +RUN pnpm build + +# Production - serve static files with nginx +FROM nginx:alpine + +COPY --from=builder /app/out /usr/share/nginx/html + +# Create nginx config +RUN echo 'server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri.html $uri/ /index.html; } location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; } }' > /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c07270f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +services: + bondingcurve-prod: + build: . + container_name: bondingcurve-prod + restart: unless-stopped + labels: + - "traefik.enable=true" + - "traefik.http.routers.bondingcurve.rule=Host(`bondingcurve.tech`) || Host(`www.bondingcurve.tech`)" + - "traefik.http.routers.bondingcurve.entrypoints=web" + - "traefik.http.services.bondingcurve.loadbalancer.server.port=80" + networks: + - traefik-public + +networks: + traefik-public: + external: true