From 0ab19ebbe127fe5b503f11c60e7276a187ea0fce Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Sat, 7 Feb 2026 14:14:30 +0100 Subject: [PATCH] Add deployment scaffolding (Dockerfile, docker-compose, nginx) Co-Authored-By: Claude Opus 4.6 --- .dockerignore | 1 + Dockerfile | 13 +++++++++++++ backlog/config.yml | 15 +++++++++++++++ docker-compose.yml | 17 +++++++++++++++++ nginx.conf | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 backlog/config.yml create mode 100644 docker-compose.yml create mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ceb2b98 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +CLAUDE.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f3def1f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:20-alpine AS builder +WORKDIR /app +RUN corepack enable && corepack prepare pnpm@latest --activate +COPY package.json pnpm-lock.yaml* package-lock.json* ./ +RUN if [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; elif [ -f package-lock.json ]; then npm ci; else npm install; fi +COPY . . +RUN if [ -f pnpm-lock.yaml ]; then pnpm build; else npm run build; fi + +FROM nginx:alpine +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /app/out /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/backlog/config.yml b/backlog/config.yml new file mode 100644 index 0000000..7396e0e --- /dev/null +++ b/backlog/config.yml @@ -0,0 +1,15 @@ +project_name: "psilo-cybernetics-website" +default_status: "To Do" +statuses: ["To Do", "In Progress", "Done"] +labels: [] +milestones: [] +date_format: yyyy-mm-dd +max_column_width: 20 +auto_open_browser: true +default_port: 6420 +remote_operations: true +auto_commit: false +zero_padded_ids: 3 +bypass_git_hooks: false +check_active_branches: true +active_branch_days: 60 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..30919de --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +services: + psilo: + build: . + image: psilo-prod:latest + container_name: psilo-prod + restart: always + networks: + - traefik-public + labels: + - "traefik.enable=true" + - "traefik.http.routers.psilo.rule=Host(`psilo-cyber.net`) || Host(`www.psilo-cyber.net`)" + - "traefik.http.routers.psilo.entrypoints=web" + - "traefik.http.services.psilo.loadbalancer.server.port=80" + +networks: + traefik-public: + external: true diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..17808b4 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,39 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Enable gzip compression + gzip on; + gzip_vary on; + gzip_min_length 1024; + gzip_proxied any; + gzip_types text/plain text/css text/xml text/javascript application/javascript application/json application/xml+rss; + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + + # Handle Next.js static export routes + location / { + # Try exact file, then .html extension, then directory, then fallback to index.html + try_files $uri $uri.html $uri/ /index.html; + } + + # Cache static assets + location /_next/static/ { + add_header Cache-Control "public, max-age=31536000, immutable"; + } + + # Cache other static files + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, max-age=31536000"; + } + + # Custom error pages + error_page 404 /404.html; + error_page 500 502 503 504 /500.html; +}