Skip to content

Commit

Permalink
Build landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jul 23, 2024
1 parent 48abc02 commit a8fb34d
Show file tree
Hide file tree
Showing 11 changed files with 754 additions and 437 deletions.
30 changes: 30 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
groups:
action-packages:
patterns:
- "*"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
groups:
docker:
patterns:
- "*"


- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
groups:
yarn-packages:
patterns:
- "*"
39 changes: 39 additions & 0 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Build and Push Docker Images

on: push
# push:
# branches:
# - main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}

jobs:
build-and-push-backend:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out code
uses: actions/[email protected]

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.WRITE_PACKAGE_TOKEN }}

- name: Build and push image
id: management_landing_build
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
context: ./
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/management-landing:${{ github.sha }}

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.idea
# dependencies
/node_modules
/.pnp
Expand Down
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM node:22-alpine AS base

FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

ENV NEXT_TELEMETRY_DISABLED 1

RUN yarn run build

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1


RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT 3000

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD HOSTNAME="0.0.0.0" node server.js
4 changes: 3 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
output: "standalone"
};

export default nextConfig;
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@
"lint": "next lint"
},
"dependencies": {
"@emotion/cache": "^11.13.0",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@mui/material": "^5.16.4",
"@mui/material-nextjs": "^5.16.4",
"next": "14.2.5",
"react": "^18",
"react-dom": "^18",
"next": "14.2.5"
"react-dom": "^18"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "14.2.5"
"eslint-config-next": "14.2.5",
"prettier": "^3.3.3",
"typescript": "^5"
}
}
107 changes: 0 additions & 107 deletions src/app/globals.css

This file was deleted.

8 changes: 6 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { AppRouterCacheProvider } from "@mui/material-nextjs/v13-appRouter";
import { CssBaseline } from "@mui/material";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -16,7 +17,10 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<CssBaseline />
<AppRouterCacheProvider>{children}</AppRouterCacheProvider>
</body>
</html>
);
}
Loading

0 comments on commit a8fb34d

Please sign in to comment.