diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-28 19:23:44 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-28 19:23:44 +0100 |
| commit | 24a505d2f7c47b837d4ada2569576af594975fce (patch) | |
| tree | a9bf16ada4d323d6763293142f9723953079ac1d /174bg | |
| parent | 02b47120435f7953c5578f70f541d98a718e12bc (diff) | |
| download | unnamed-group-24a505d2f7c47b837d4ada2569576af594975fce.tar unnamed-group-24a505d2f7c47b837d4ada2569576af594975fce.tar.gz unnamed-group-24a505d2f7c47b837d4ada2569576af594975fce.tar.bz2 unnamed-group-24a505d2f7c47b837d4ada2569576af594975fce.tar.xz unnamed-group-24a505d2f7c47b837d4ada2569576af594975fce.zip | |
website w/ docker!
Diffstat (limited to '174bg')
| -rw-r--r-- | 174bg/website-nextjs/.gitignore | 41 | ||||
| -rw-r--r-- | 174bg/website/.gitignore | 42 | ||||
| -rw-r--r-- | 174bg/website/.prettierrc.json (renamed from 174bg/website-nextjs/.prettierrc.json) | 0 | ||||
| -rw-r--r-- | 174bg/website/AGENTS.md (renamed from 174bg/website-nextjs/AGENTS.md) | 0 | ||||
| -rw-r--r-- | 174bg/website/CLAUDE.md (renamed from 174bg/website-nextjs/CLAUDE.md) | 0 | ||||
| -rw-r--r-- | 174bg/website/Dockerfile | 112 | ||||
| -rw-r--r-- | 174bg/website/README.md (renamed from 174bg/website-nextjs/README.md) | 0 | ||||
| -rw-r--r-- | 174bg/website/assets/index.html | 82 | ||||
| -rw-r--r-- | 174bg/website/assets/logo.png | bin | 47784 -> 0 bytes | |||
| -rw-r--r-- | 174bg/website/docker-compose.yaml | 6 | ||||
| -rw-r--r-- | 174bg/website/eslint.config.mjs (renamed from 174bg/website-nextjs/eslint.config.mjs) | 0 | ||||
| -rw-r--r-- | 174bg/website/jsconfig.json (renamed from 174bg/website-nextjs/jsconfig.json) | 0 | ||||
| -rw-r--r-- | 174bg/website/next.config.mjs (renamed from 174bg/website-nextjs/next.config.mjs) | 1 | ||||
| -rw-r--r-- | 174bg/website/package-lock.json (renamed from 174bg/website-nextjs/package-lock.json) | 0 | ||||
| -rw-r--r-- | 174bg/website/package.json (renamed from 174bg/website-nextjs/package.json) | 0 | ||||
| -rw-r--r-- | 174bg/website/postcss.config.mjs (renamed from 174bg/website-nextjs/postcss.config.mjs) | 0 | ||||
| -rw-r--r-- | 174bg/website/public/logo.png (renamed from 174bg/website-nextjs/public/logo.png) | bin | 11998 -> 11998 bytes | |||
| -rw-r--r-- | 174bg/website/src/app/layout.css (renamed from 174bg/website-nextjs/src/app/layout.css) | 0 | ||||
| -rw-r--r-- | 174bg/website/src/app/layout.js (renamed from 174bg/website-nextjs/src/app/layout.js) | 0 | ||||
| -rw-r--r-- | 174bg/website/src/app/page.js (renamed from 174bg/website-nextjs/src/app/page.js) | 0 | ||||
| -rw-r--r-- | 174bg/website/worker.js | 45 | ||||
| -rw-r--r-- | 174bg/website/wrangler.jsonc | 28 |
22 files changed, 160 insertions, 197 deletions
diff --git a/174bg/website-nextjs/.gitignore b/174bg/website-nextjs/.gitignore deleted file mode 100644 index 5ef6a52..0000000 --- a/174bg/website-nextjs/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/versions - -# testing -/coverage - -# next.js -/.next/ -/out/ - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# env files (can opt-in for committing if needed) -.env* - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts diff --git a/174bg/website/.gitignore b/174bg/website/.gitignore index 0460e34..5ef6a52 100644 --- a/174bg/website/.gitignore +++ b/174bg/website/.gitignore @@ -1 +1,41 @@ -/.wrangler/
\ No newline at end of file +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/174bg/website-nextjs/.prettierrc.json b/174bg/website/.prettierrc.json index 9e26dfe..9e26dfe 100644 --- a/174bg/website-nextjs/.prettierrc.json +++ b/174bg/website/.prettierrc.json diff --git a/174bg/website-nextjs/AGENTS.md b/174bg/website/AGENTS.md index caeace2..caeace2 100644 --- a/174bg/website-nextjs/AGENTS.md +++ b/174bg/website/AGENTS.md diff --git a/174bg/website-nextjs/CLAUDE.md b/174bg/website/CLAUDE.md index 43c994c..43c994c 100644 --- a/174bg/website-nextjs/CLAUDE.md +++ b/174bg/website/CLAUDE.md diff --git a/174bg/website/Dockerfile b/174bg/website/Dockerfile new file mode 100644 index 0000000..bf4fce4 --- /dev/null +++ b/174bg/website/Dockerfile @@ -0,0 +1,112 @@ +# ============================================ +# Stage 1: Dependencies Installation Stage +# ============================================ + +# IMPORTANT: Node.js Version Maintenance +# This Dockerfile uses Node.js 24.13.0-slim, which was the latest LTS version at the time of writing. +# To ensure security and compatibility, regularly update the NODE_VERSION ARG to the latest LTS version. +ARG NODE_VERSION=24.13.0-slim + +FROM node:${NODE_VERSION} AS dependencies + +# Set working directory +WORKDIR /app + +# Copy package-related files first to leverage Docker's caching mechanism +COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./ + +# Install project dependencies with frozen lockfile for reproducible builds +RUN --mount=type=cache,target=/root/.npm \ + --mount=type=cache,target=/usr/local/share/.cache/yarn \ + --mount=type=cache,target=/root/.local/share/pnpm/store \ + if [ -f package-lock.json ]; then \ + npm ci --no-audit --no-fund; \ + elif [ -f yarn.lock ]; then \ + corepack enable yarn && yarn install --frozen-lockfile --production=false; \ + elif [ -f pnpm-lock.yaml ]; then \ + corepack enable pnpm && pnpm install --frozen-lockfile; \ + else \ + echo "No lockfile found." && exit 1; \ + fi + +# ============================================ +# Stage 2: Build Next.js application in standalone mode +# ============================================ + +FROM node:${NODE_VERSION} AS builder + +# Set working directory +WORKDIR /app + +# Copy project dependencies from dependencies stage +COPY --from=dependencies /app/node_modules ./node_modules + +# Copy application source code +COPY . . + +ENV NODE_ENV=production + +# Next.js collects completely anonymous telemetry data about general usage. +# Learn more here: https://nextjs.org/telemetry +# Uncomment the following line in case you want to disable telemetry during the build. +# ENV NEXT_TELEMETRY_DISABLED=1 + +# Build Next.js application +# If you want to speed up Docker rebuilds, you can cache the build artifacts +# by adding: --mount=type=cache,target=/app/.next/cache +# This caches the .next/cache directory across builds, but it also prevents +# .next/cache/fetch-cache from being included in the final image, meaning +# cached fetch responses from the build won't be available at runtime. +RUN if [ -f package-lock.json ]; then \ + npm run build; \ + elif [ -f yarn.lock ]; then \ + corepack enable yarn && yarn build; \ + elif [ -f pnpm-lock.yaml ]; then \ + corepack enable pnpm && pnpm build; \ + else \ + echo "No lockfile found." && exit 1; \ + fi + +# ============================================ +# Stage 3: Run Next.js application +# ============================================ + +FROM node:${NODE_VERSION} AS runner + +# Set working directory +WORKDIR /app + +# Set production environment variables +ENV NODE_ENV=production +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" + +# Next.js collects completely anonymous telemetry data about general usage. +# Learn more here: https://nextjs.org/telemetry +# Uncomment the following line in case you want to disable telemetry during the run time. +# ENV NEXT_TELEMETRY_DISABLED=1 + +# Copy production assets +COPY --from=builder --chown=node:node /app/public ./public + +# Set the correct permission for prerender cache +RUN mkdir .next +RUN chown node:node .next + +# Automatically leverage output traces to reduce image size +# https://nextjs.org/docs/advanced-features/output-file-tracing +COPY --from=builder --chown=node:node /app/.next/standalone ./ +COPY --from=builder --chown=node:node /app/.next/static ./.next/static + +# If you want to persist the fetch cache generated during the build so that +# cached responses are available immediately on startup, uncomment this line: +# COPY --from=builder --chown=node:node /app/.next/cache ./.next/cache + +# Switch to non-root user for security best practices +USER node + +# Expose port 3000 to allow HTTP traffic +EXPOSE 3000 + +# Start Next.js standalone server +CMD ["node", "server.js"]
\ No newline at end of file diff --git a/174bg/website-nextjs/README.md b/174bg/website/README.md index 66bb426..66bb426 100644 --- a/174bg/website-nextjs/README.md +++ b/174bg/website/README.md diff --git a/174bg/website/assets/index.html b/174bg/website/assets/index.html deleted file mode 100644 index 6b75afe..0000000 --- a/174bg/website/assets/index.html +++ /dev/null @@ -1,82 +0,0 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>174th Battle Group - Star Citizen Military Organisation</title> - <style> - @import url('https://fonts.googleapis.com/css2?family=Sora:wght@100..800&display=swap'); - - body { - margin: 1rem; - max-width: 666px; - font-family: 'Sora', sans-serif; - } - - p { - text-align: justify; - } - - a { - color: red; - text-decoration: none; - } - - #header { - display: flex; - align-items: center; - margin-bottom: 1rem; - } - - #logo { - width: 100px; - height: auto; - } - </style> -</head> -<body> - <div id="header"> - <img id="logo" src="logo.png"> - <div style="margin-left: 1rem; display: flex; flex-direction: column; justify-content: center; height: 100px;"> - <h1 style="margin: 0;">174th Battle Group</h1> - <h2 style="color: rgb(158, 0, 0); margin: 0;">The "Red Right Hand" of the UEE</h2> - </div> - </div> - - <!-- elevator pitch --> - <p> - We're a Star Citizen organisation focused on structured play, small-team tactics, and distributed operations, aiming to provide a rich and varied experience for our members. - </p> - <!-- ops times and attendance --> - <p> - Our bigger sessions are held on Saturdays around 17-18:00 UTC and usually last 4 hours. We also run smaller weekday sessions using an "on call" system. Members are expected to attend at least one bigger session every two weeks, though real life comes first and we will work around schedules. - </p> - <!-- entry requirements and how to join --> - <p> - We welcome anyone interested in joining, regardless of experience. New members must be respectful, professional, and follow our code of conduct. They should either know Star Citizen and its mechanics or be willing to learn and improve. - </p> - <!-- final pitch to join --> - <p> - If you're interested in joining the 174th Battle Group, reach out through our Discord server below. We look forward to welcoming you and working together toward our goals in the 'verse. - </p> - - <!-- links --> - <p style="flex-direction: column; display: flex; gap: 0.5rem;"> - <div> - <b>Discord:</b> <a href="https://174bg.net/discord" target="_blank">174bg.net/discord</a> - </div> - <div> - <b>Handbook:</b> <a href="https://174bg.net/handbook" target="_blank">174bg.net/handbook</a> - </div> - <div> - <b>Manager:</b> <a href="https://174bg.net/manager" target="_blank">174bg.net/manager</a> - </div> - </p> - - - <!-- cryptic shit --> - <span style="position: absolute; bottom: 1rem; right: 1rem; font-size: 0.8rem; opacity: 0.33;"> - Expose. Exploit. Erase. - </span> -</body> -</html>
\ No newline at end of file diff --git a/174bg/website/assets/logo.png b/174bg/website/assets/logo.png Binary files differdeleted file mode 100644 index 082d182..0000000 --- a/174bg/website/assets/logo.png +++ /dev/null diff --git a/174bg/website/docker-compose.yaml b/174bg/website/docker-compose.yaml new file mode 100644 index 0000000..87e41cb --- /dev/null +++ b/174bg/website/docker-compose.yaml @@ -0,0 +1,6 @@ +# this is the compose file we deploy to the server +services: + app: + build: https://github.com/EpicGames/lore.git#master:174bg/website + ports: + - "3892:3000" diff --git a/174bg/website-nextjs/eslint.config.mjs b/174bg/website/eslint.config.mjs index f443835..f443835 100644 --- a/174bg/website-nextjs/eslint.config.mjs +++ b/174bg/website/eslint.config.mjs diff --git a/174bg/website-nextjs/jsconfig.json b/174bg/website/jsconfig.json index b8d6842..b8d6842 100644 --- a/174bg/website-nextjs/jsconfig.json +++ b/174bg/website/jsconfig.json diff --git a/174bg/website-nextjs/next.config.mjs b/174bg/website/next.config.mjs index 690d2d0..218fe4a 100644 --- a/174bg/website-nextjs/next.config.mjs +++ b/174bg/website/next.config.mjs @@ -2,6 +2,7 @@ const nextConfig = { /* config options here */ reactCompiler: true, + output: "standalone", }; export default nextConfig; diff --git a/174bg/website-nextjs/package-lock.json b/174bg/website/package-lock.json index 272c5b3..272c5b3 100644 --- a/174bg/website-nextjs/package-lock.json +++ b/174bg/website/package-lock.json diff --git a/174bg/website-nextjs/package.json b/174bg/website/package.json index 118ae0d..118ae0d 100644 --- a/174bg/website-nextjs/package.json +++ b/174bg/website/package.json diff --git a/174bg/website-nextjs/postcss.config.mjs b/174bg/website/postcss.config.mjs index 61e3684..61e3684 100644 --- a/174bg/website-nextjs/postcss.config.mjs +++ b/174bg/website/postcss.config.mjs diff --git a/174bg/website-nextjs/public/logo.png b/174bg/website/public/logo.png Binary files differindex a6b77d8..a6b77d8 100644 --- a/174bg/website-nextjs/public/logo.png +++ b/174bg/website/public/logo.png diff --git a/174bg/website-nextjs/src/app/layout.css b/174bg/website/src/app/layout.css index 030d913..030d913 100644 --- a/174bg/website-nextjs/src/app/layout.css +++ b/174bg/website/src/app/layout.css diff --git a/174bg/website-nextjs/src/app/layout.js b/174bg/website/src/app/layout.js index c2b65f2..c2b65f2 100644 --- a/174bg/website-nextjs/src/app/layout.js +++ b/174bg/website/src/app/layout.js diff --git a/174bg/website-nextjs/src/app/page.js b/174bg/website/src/app/page.js index ebd46cc..ebd46cc 100644 --- a/174bg/website-nextjs/src/app/page.js +++ b/174bg/website/src/app/page.js diff --git a/174bg/website/worker.js b/174bg/website/worker.js deleted file mode 100644 index d5e2753..0000000 --- a/174bg/website/worker.js +++ /dev/null @@ -1,45 +0,0 @@ -const configuration = { - redirects: [ - { from: "/discord", to: "https://discord.gg/RGgSfVj4DD" }, - { from: "/handbook", to: "https://handbook.174bg.net" }, - { from: "/docs", to: "https://handbook.174bg.net" }, - { from: "/manager", to: "https://manager.174bg.net" }, - { from: "/login", to: "https://manager.174bg.net" }, - { from: "/database", to: "https://db.174bg.net" }, - { from: "/db", to: "https://db.174bg.net" }, - ], -}; - -export default { - /** - * Fetch event handler, this function will be called whenever a request is made to the worker. The function will parse the request and return a response based on the request path. - * - * @param {Request} request - the incoming request object - * @param {Environment} environment - the environment object - * @param {Context} context - the context object - * - * @returns {Response} a new Response object - */ - async fetch(request, environment, context) { - const url = new URL(request.url); - - if (configuration.redirects) { - for (const redirect of configuration.redirects) { - if ( - url.pathname === redirect.from || - url.pathname === redirect.from + "/" - ) { - return Response.redirect(redirect.to, 301); - } - } - } - - if (url.pathname.startsWith("/api")) { - return new Response("Hello from the API!", { - headers: { "Content-Type": "text/plain" }, - }); - } - - return environment.ASSETS.fetch(new Request(url, request)); - } -};
\ No newline at end of file diff --git a/174bg/website/wrangler.jsonc b/174bg/website/wrangler.jsonc deleted file mode 100644 index d9cb044..0000000 --- a/174bg/website/wrangler.jsonc +++ /dev/null @@ -1,28 +0,0 @@ -{ - "$schema": "https://esm.sh/wrangler@4.90.1/config-schema.json", - "compatibility_flags": ["nodejs_compat"], - "compatibility_date": "2026-03-29", - "account_id": "424d9dabd39849818d9e22366a20e4d6", - "name": "www-174bg-net", - "main": "./worker.js", - "assets": { - "directory": "./assets/", - "not_found_handling": "single-page-application", - "binding": "ASSETS", - "run_worker_first": true, - }, - "minify": true, - "observability": { - "enabled": true, - }, - "routes": [ - { - "pattern": "174bg.net", - "custom_domain": true, - }, - { - "pattern": "www.174bg.net", - "custom_domain": true, - }, - ], -} |
