diff --git a/Dockerfile.prod b/Dockerfile.prod new file mode 100644 index 0000000..98f13ed --- /dev/null +++ b/Dockerfile.prod @@ -0,0 +1,30 @@ +FROM oven/bun:1-alpine AS builder + +WORKDIR /app + +COPY package.json package-lock.json* bun.lock* ./ +RUN bun install --frozen-lockfile + +COPY . . + +RUN bun run build + +FROM oven/bun:1-alpine AS runner + +RUN addgroup -g 1001 -S nextjs && \ + adduser -S nextjs -u 1001 -G nextjs + +WORKDIR /app + +ENV NODE_ENV=production +ENV HOSTNAME="0.0.0.0" + +COPY --from=builder --chown=nextjs:nextjs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nextjs /app/.next/static ./.next/static +COPY --from=builder --chown=nextjs:nextjs /app/public ./public + +USER nextjs + +EXPOSE 3000 + +CMD ["bun", "server.js"] diff --git a/app/games/page.tsx b/app/games/page.tsx index 85ce4a5..ff15933 100644 --- a/app/games/page.tsx +++ b/app/games/page.tsx @@ -45,9 +45,9 @@ const games: GameCard[] = [ { title: "Snake", description: "Guide the snake to eat food and grow longer without hitting the walls or yourself.", - href: "#", + href: "/games/snake", emoji: "🐍", - available: false, + available: true, }, { title: "Tetris", diff --git a/app/games/snake/page.tsx b/app/games/snake/page.tsx new file mode 100644 index 0000000..ad567d2 --- /dev/null +++ b/app/games/snake/page.tsx @@ -0,0 +1,56 @@ +import type { Metadata } from "next" +import Link from "next/link" +import { Header } from "@/components/layout/header" +import { Footer } from "@/components/layout/footer" +import { SITE_URL, TITLE_BASE, pageKeywords } from "@/lib/seo" +import { ArrowLeft } from "lucide-react" +import { SnakeEmbed } from "./snake-embed" + +export const metadata: Metadata = { + title: "Snake", + description: + "Play Snake in your browser. Collect food, grow longer, and avoid crashing into yourself.", + keywords: pageKeywords(["snake", "retro game", "arcade game", "browser game"]), + alternates: { + canonical: "/games/snake", + }, + openGraph: { + title: `Snake | ${TITLE_BASE}`, + description: "Play Snake in your browser. Collect food, grow longer, and avoid crashing into yourself.", + url: `${SITE_URL}/games/snake`, + type: "website", + }, + twitter: { + card: "summary_large_image", + title: `Snake | ${TITLE_BASE}`, + description: "Play Snake in your browser. Collect food, grow longer, and avoid crashing into yourself.", + }, +} + +export default function SnakePage() { + return ( +