Skip to content

Commit bbf3386

Browse files
author
Mikko Forsström
committed
Independence from Trumpland!
1 parent 6fbe7f2 commit bbf3386

File tree

13 files changed

+4486
-5008
lines changed

13 files changed

+4486
-5008
lines changed

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
git/
2+
.git*
3+
node_modules
4+
/docker

.eslintrc.cjs

Lines changed: 0 additions & 27 deletions
This file was deleted.

compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
next:
3+
build:
4+
dockerfile: docker/next/Dockerfile
5+
networks:
6+
- web
7+
ports:
8+
- 3300:3000
9+
networks:
10+
web:
11+
driver: bridge

docker/next/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# syntax=docker.io/docker/dockerfile:1
2+
3+
FROM node:22-alpine AS base
4+
5+
# Install dependencies only when needed
6+
FROM base AS deps
7+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
8+
RUN apk add --no-cache libc6-compat
9+
WORKDIR /app
10+
11+
# Install dependencies based on the preferred package manager
12+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc* ./
13+
RUN corepack enable && pnpm i --frozen-lockfile
14+
15+
# Rebuild the source code only when needed
16+
FROM base AS builder
17+
WORKDIR /app
18+
COPY --from=deps /app/node_modules ./node_modules
19+
COPY . .
20+
21+
# Next.js collects completely anonymous telemetry data about general usage.
22+
# Learn more here: https://nextjs.org/telemetry
23+
# Uncomment the following line in case you want to disable telemetry during the build.
24+
# ENV NEXT_TELEMETRY_DISABLED=1
25+
26+
RUN corepack enable pnpm && pnpm run build
27+
28+
# Production image, copy all the files and run next
29+
FROM base AS runner
30+
WORKDIR /app
31+
32+
ENV NODE_ENV=production
33+
# Uncomment the following line in case you want to disable telemetry during runtime.
34+
# ENV NEXT_TELEMETRY_DISABLED=1
35+
36+
RUN addgroup --system --gid 1001 nodejs
37+
RUN adduser --system --uid 1001 nextjs
38+
39+
COPY --from=builder /app/public ./public
40+
41+
# Automatically leverage output traces to reduce image size
42+
# https://nextjs.org/docs/advanced-features/output-file-tracing
43+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
44+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
45+
46+
USER nextjs
47+
48+
EXPOSE 3000
49+
50+
ENV PORT=3000
51+
52+
# server.js is created by next build from the standalone output
53+
# https://nextjs.org/docs/pages/api-reference/config/next-config-js/output
54+
ENV HOSTNAME="0.0.0.0"
55+
CMD ["node", "server.js"]

docker/nginx.conf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
server {
2+
server_name hardcore-react-training.pekkis.eu;
3+
4+
root /var/www/html;
5+
server_name hardcore-react-training.pekkis.eu;
6+
7+
#gzip
8+
gzip on;
9+
gzip_vary on;
10+
gzip_comp_level 6;
11+
gzip_types application/x-font-ttf image/svg+xml text/xml text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml text/javascript;
12+
13+
#brotli
14+
brotli on;
15+
brotli_comp_level 6;
16+
brotli_types application/x-font-ttf image/svg+xml text/xml text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml text/javascript;
17+
18+
location / {
19+
proxy_pass http://localhost:3300;
20+
}
21+
22+
listen 443 ssl;
23+
}
24+
25+
server {
26+
if ($host = hardcore-react-training.pekkis.eu) {
27+
return 301 https://$host$request_uri;
28+
}
29+
30+
listen 80;
31+
server_name hardcore-react-training.pekkis.eu;
32+
return 404;
33+
}

eslint.config.mjs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import tseslint from "typescript-eslint";
2+
import jsxA11Y from "eslint-plugin-jsx-a11y";
3+
import js from "@eslint/js";
4+
import pluginReactHooks from "eslint-plugin-react-hooks";
5+
import reactPlugin from "eslint-plugin-react";
6+
import nextPlugin from "@next/eslint-plugin-next";
7+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
8+
9+
export default [
10+
js.configs.recommended,
11+
...tseslint.configs.recommended,
12+
13+
jsxA11Y.flatConfigs.recommended,
14+
15+
{
16+
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
17+
...reactPlugin.configs.flat.recommended,
18+
languageOptions: {
19+
...reactPlugin.configs.flat.recommended.languageOptions
20+
},
21+
settings: {
22+
react: {
23+
version: "detect"
24+
}
25+
}
26+
},
27+
28+
{
29+
files: ["src/**/*.{js,ts,jsx,tsx}"],
30+
...reactPlugin.configs.flat.recommended,
31+
plugins: {
32+
"react-hooks": pluginReactHooks
33+
},
34+
rules: {
35+
...pluginReactHooks.configs.recommended.rules,
36+
"react/react-in-jsx-scope": "off",
37+
"react/prop-types": "off"
38+
}
39+
},
40+
41+
{
42+
plugins: {
43+
"@next/next": nextPlugin
44+
},
45+
rules: {
46+
...nextPlugin.configs.recommended.rules,
47+
...nextPlugin.configs["core-web-vitals"].rules
48+
}
49+
},
50+
51+
eslintPluginPrettierRecommended
52+
];

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const withBundleAnalyzer = bundleAnalyzer({
1212

1313
/** @type {import('next').NextConfig} */
1414
const nextConfig = {
15+
output: "standalone",
1516
reactStrictMode: true,
1617
typescript: {
1718
ignoreBuildErrors: false

package.json

Lines changed: 68 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -26,80 +26,83 @@
2626
"author": "Pekkis",
2727
"license": "MIT",
2828
"dependencies": {
29-
"@hookform/resolvers": "^3.9.0",
30-
"@react-three/fiber": "^8.17.8",
31-
"@tanstack/react-query": "^5.56.2",
32-
"@tanstack/react-query-devtools": "^5.58.0",
33-
"@vanilla-extract/css": "^1.15.5",
29+
"@hookform/resolvers": "^5.0.1",
30+
"@react-three/fiber": "^9.1.2",
31+
"@tanstack/react-query": "^5.71.10",
32+
"@tanstack/react-query-devtools": "^5.71.10",
33+
"@vanilla-extract/css": "^1.17.1",
3434
"@vanilla-extract/sprinkles": "^1.6.3",
3535
"clsx": "^2.1.1",
36-
"currency-codes": "^2.1.0",
37-
"framer-motion": "^11.9.0",
36+
"currency-codes": "^2.2.0",
37+
"framer-motion": "^12.6.3",
3838
"immer": "^10.1.1",
39-
"ky": "^1.7.2",
40-
"luxon": "^3.5.0",
41-
"next": "^14.2.13",
39+
"ky": "^1.8.0",
40+
"luxon": "^3.6.1",
41+
"next": "^15.2.4",
4242
"normalize.css": "^8.0.1",
43-
"react": "18.3.1",
44-
"react-dom": "^18.3.1",
45-
"react-error-boundary": "^4.0.13",
46-
"react-hook-form": "^7.53.0",
47-
"react-icons": "^5.3.0",
48-
"react-markdown": "^9.0.1",
49-
"remeda": "^2.14.0",
50-
"sharp": "^0.33.5",
51-
"three": "^0.169.0",
52-
"zod": "^3.23.8",
53-
"zustand": "4.5.5"
43+
"react": "19.1.0",
44+
"react-dom": "^19.1.0",
45+
"react-error-boundary": "^5.0.0",
46+
"react-hook-form": "^7.55.0",
47+
"react-icons": "^5.5.0",
48+
"react-markdown": "^10.1.0",
49+
"remeda": "^2.21.2",
50+
"sharp": "^0.34.0",
51+
"three": "^0.175.0",
52+
"zod": "^3.24.2",
53+
"zustand": "5.0.3"
5454
},
5555
"devDependencies": {
56-
"@chromatic-com/storybook": "^2.0.2",
57-
"@next/bundle-analyzer": "^14.2.13",
58-
"@playwright/test": "^1.47.2",
59-
"@storybook/addon-essentials": "^8.3.3",
60-
"@storybook/addon-interactions": "^8.3.3",
61-
"@storybook/addon-links": "^8.3.3",
62-
"@storybook/addon-styling-webpack": "^1.0.0",
63-
"@storybook/blocks": "^8.3.3",
64-
"@storybook/nextjs": "^8.3.3",
65-
"@storybook/react": "^8.3.3",
66-
"@storybook/test": "^8.3.3",
56+
"@chromatic-com/storybook": "^3.2.6",
57+
"@eslint/js": "^9.24.0",
58+
"@next/bundle-analyzer": "^15.2.4",
59+
"@next/eslint-plugin-next": "^15.2.4",
60+
"@playwright/test": "^1.51.1",
61+
"@storybook/addon-essentials": "^8.6.12",
62+
"@storybook/addon-interactions": "^8.6.12",
63+
"@storybook/addon-links": "^8.6.12",
64+
"@storybook/addon-styling-webpack": "^1.0.1",
65+
"@storybook/blocks": "^8.6.12",
66+
"@storybook/nextjs": "^8.6.12",
67+
"@storybook/react": "^8.6.12",
68+
"@storybook/test": "^8.6.12",
6769
"@testing-library/dom": "^10.4.0",
68-
"@testing-library/jest-dom": "^6.5.0",
69-
"@testing-library/react": "^16.0.1",
70-
"@testing-library/user-event": "^14.5.2",
71-
"@types/luxon": "^3.4.2",
72-
"@types/node": "^22.7.4",
73-
"@types/react": "^18.3.10",
74-
"@types/react-dom": "^18.3.0",
75-
"@types/three": "^0.169.0",
76-
"@typescript-eslint/eslint-plugin": "^8.7.0",
77-
"@typescript-eslint/parser": "^8.7.0",
78-
"@vanilla-extract/next-plugin": "^2.4.5",
79-
"@vanilla-extract/webpack-plugin": "^2.3.13",
80-
"@vitejs/plugin-react": "^4.3.1",
70+
"@testing-library/jest-dom": "^6.6.3",
71+
"@testing-library/react": "^16.3.0",
72+
"@testing-library/user-event": "^14.6.1",
73+
"@types/luxon": "^3.6.2",
74+
"@types/node": "^22.14.0",
75+
"@types/react": "^19.1.0",
76+
"@types/react-dom": "^19.1.1",
77+
"@types/three": "^0.175.0",
78+
"@typescript-eslint/eslint-plugin": "^8.29.0",
79+
"@typescript-eslint/parser": "^8.29.0",
80+
"@vanilla-extract/next-plugin": "^2.4.10",
81+
"@vanilla-extract/webpack-plugin": "^2.3.18",
82+
"@vitejs/plugin-react": "^4.3.4",
8183
"css-loader": "^7.1.2",
82-
"eslint": "^8.57.1",
83-
"eslint-config-next": "^14.2.13",
84-
"eslint-config-prettier": "^9.1.0",
85-
"eslint-plugin-import": "^2.30.0",
86-
"eslint-plugin-jsx-a11y": "^6.10.0",
87-
"eslint-plugin-prettier": "^5.2.1",
88-
"eslint-plugin-react": "^7.37.0",
89-
"eslint-plugin-react-hooks": "4.6.2",
90-
"eslint-plugin-storybook": "^0.9.0",
84+
"eslint": "^9.24.0",
85+
"eslint-config-next": "^15.2.4",
86+
"eslint-config-prettier": "^10.1.1",
87+
"eslint-plugin-import": "^2.31.0",
88+
"eslint-plugin-jsx-a11y": "^6.10.2",
89+
"eslint-plugin-prettier": "^5.2.6",
90+
"eslint-plugin-react": "^7.37.5",
91+
"eslint-plugin-react-hooks": "5.2.0",
92+
"eslint-plugin-storybook": "^0.12.0",
9193
"identity-obj-proxy": "^3.0.0",
92-
"jsdom": "^25.0.1",
93-
"mini-css-extract-plugin": "^2.9.1",
94-
"msw": "^2.4.9",
95-
"prettier": "^3.3.3",
96-
"storybook": "^8.3.3",
94+
"jsdom": "^26.0.0",
95+
"mini-css-extract-plugin": "^2.9.2",
96+
"msw": "^2.7.3",
97+
"prettier": "^3.5.3",
98+
"storybook": "^8.6.12",
9799
"style-loader": "^4.0.0",
98-
"stylelint": "^16.9.0",
99-
"stylelint-config-standard": "^36.0.1",
100-
"stylelint-prettier": "^5.0.2",
101-
"typescript": "~5.6.2",
102-
"vitest": "^2.1.1"
100+
"stylelint": "^16.18.0",
101+
"stylelint-config-standard": "^38.0.0",
102+
"stylelint-prettier": "^5.0.3",
103+
"typescript": "~5.8.3",
104+
"typescript-eslint": "^8.29.0",
105+
"vitest": "^3.1.1"
103106
},
104-
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
107+
"packageManager": "pnpm@10.7.1+sha512.2d92c86b7928dc8284f53494fb4201f983da65f0fb4f0d40baafa5cf628fa31dae3e5968f12466f17df7e97310e30f343a648baea1b9b350685dafafffdf5808"
105108
}

0 commit comments

Comments
 (0)