diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c1c04b1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,27 @@ +# Git +.git +.gitignore + +# Development +node_modules +.next +.cache + +# Documentation +README.md +CLAUDE.md +*.md + +# IDE +.idea +.vscode +*.swp + +# OS +.DS_Store +Thumbs.db + +# Environment (keep .env.example) +.env +.env.local +.env*.local 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..14e045d --- /dev/null +++ b/backlog/config.yml @@ -0,0 +1,15 @@ +project_name: "mytmux.life-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..c0d99d8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +services: + mytmux: + build: . + image: mytmux-prod:latest + container_name: mytmux-prod + restart: always + networks: + - traefik-public + labels: + - "traefik.enable=true" + - "traefik.http.routers.mytmux.rule=Host(`mytmux.life`) || Host(`www.mytmux.life`)" + - "traefik.http.routers.mytmux.entrypoints=web" + - "traefik.http.services.mytmux.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; +}