docker fix
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 49s
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 49s
This commit is contained in:
85
Dockerfile
85
Dockerfile
@@ -1,71 +1,20 @@
|
|||||||
# syntax=docker.io/docker/dockerfile:1
|
FROM node:lts-alpine AS deps
|
||||||
|
|
||||||
FROM node:lts-alpine AS base
|
|
||||||
|
|
||||||
FROM base AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN corepack enable && corepack prepare yarn@4.9.1 --activate
|
||||||
RUN corepack enable \
|
COPY package.json yarn.lock .yarnrc.yml ./
|
||||||
&& corepack prepare yarn@4.9.1 --activate
|
RUN yarn install --immutable
|
||||||
|
FROM node:lts-alpine AS runner
|
||||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
|
|
||||||
RUN \
|
|
||||||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
|
||||||
elif [ -f package-lock.json ]; then npm ci; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i; \
|
|
||||||
else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
COPY src ./src
|
|
||||||
COPY public ./public
|
|
||||||
COPY next.config.ts .
|
|
||||||
COPY tsconfig.json .
|
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
if [ -f yarn.lock ]; then yarn build; \
|
|
||||||
elif [ -f package-lock.json ]; then npm run build; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then pnpm build; \
|
|
||||||
else npm run build; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
FROM base AS runner
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN corepack enable && corepack prepare yarn@4.9.1 --activate \
|
||||||
COPY --from=builder /app/package.json ./
|
&& addgroup -S nodejs -g 1001 \
|
||||||
COPY --from=builder /app/yarn.lock* ./
|
&& adduser -S nextjs -u 1001
|
||||||
COPY --from=builder /app/package-lock.json* ./
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=builder /app/pnpm-lock.yaml* ./
|
COPY --from=deps /app/package.json ./package.json
|
||||||
|
COPY . .
|
||||||
RUN corepack enable \
|
RUN chown -R nextjs:nodejs /app
|
||||||
&& corepack prepare yarn@4.9.1 --activate
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
if [ -f yarn.lock ]; then \
|
|
||||||
yarn install --frozen-lockfile; \
|
|
||||||
elif [ -f package-lock.json ]; then \
|
|
||||||
npm ci; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then \
|
|
||||||
corepack enable pnpm && pnpm install; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
COPY --from=builder /app/src ./src
|
|
||||||
COPY --from=builder /app/public ./public
|
|
||||||
COPY --from=builder /app/next.config.ts .
|
|
||||||
COPY --from=builder /app/tsconfig.json .
|
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs \
|
|
||||||
&& adduser --system --uid 1001 nextjs
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
ENV NODE_ENV=production \
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
NEXT_TELEMETRY_DISABLED=1 \
|
||||||
|
PORT=3000
|
||||||
ENTRYPOINT ["sh","-c","\
|
EXPOSE 3000
|
||||||
if [ -f yarn.lock ]; then yarn build; \
|
CMD ["sh", "-c", "yarn build && yarn start -p $PORT"]
|
||||||
elif [ -f package-lock.json ]; then npm run build; \
|
|
||||||
elif [ -f pnpm-lock.yaml ]; then pnpm build; \
|
|
||||||
else npm run build; \
|
|
||||||
fi && node server.js"]
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {};
|
||||||
output: "standalone",
|
|
||||||
};
|
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
@@ -185,7 +185,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[0.9, 8.5, 1.65]}>
|
<Billboard position={[0.9, 8.5, 1.65]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.75}
|
fontSize={0.75}
|
||||||
outlineWidth={0.05}
|
outlineWidth={0.05}
|
||||||
fillOpacity={mainMenuSpring.opacity}
|
fillOpacity={mainMenuSpring.opacity}
|
||||||
@@ -228,7 +228,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[-5.5, 7.5, -2]}>
|
<Billboard position={[-5.5, 7.5, -2]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.75}
|
fontSize={0.75}
|
||||||
outlineWidth={0.05}
|
outlineWidth={0.05}
|
||||||
fillOpacity={mainMenuSpring.opacity}
|
fillOpacity={mainMenuSpring.opacity}
|
||||||
@@ -271,7 +271,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[2.525, 7.5, 6.75]}>
|
<Billboard position={[2.525, 7.5, 6.75]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.75}
|
fontSize={0.75}
|
||||||
outlineWidth={0.05}
|
outlineWidth={0.05}
|
||||||
fillOpacity={mainMenuSpring.opacity}
|
fillOpacity={mainMenuSpring.opacity}
|
||||||
@@ -320,7 +320,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[2.358, 5.75, -2.055]}>
|
<Billboard position={[2.358, 5.75, -2.055]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.3125}
|
fontSize={0.3125}
|
||||||
outlineWidth={1 / 48}
|
outlineWidth={1 / 48}
|
||||||
fillOpacity={desktopMenuSpring.opacity}
|
fillOpacity={desktopMenuSpring.opacity}
|
||||||
@@ -366,7 +366,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[3.25, 6.607, 1.668]}>
|
<Billboard position={[3.25, 6.607, 1.668]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.3125}
|
fontSize={0.3125}
|
||||||
outlineWidth={1 / 48}
|
outlineWidth={1 / 48}
|
||||||
fillOpacity={desktopMenuSpring.opacity}
|
fillOpacity={desktopMenuSpring.opacity}
|
||||||
@@ -416,7 +416,7 @@ export const Buttons = ({
|
|||||||
<Billboard position={[-3.25, 6.65, -2.75]}>
|
<Billboard position={[-3.25, 6.65, -2.75]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
maxWidth={4.5}
|
maxWidth={4.5}
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.25}
|
fontSize={0.25}
|
||||||
outlineWidth={1 / 60}
|
outlineWidth={1 / 60}
|
||||||
fillOpacity={printerMenuSpring.opacity}
|
fillOpacity={printerMenuSpring.opacity}
|
||||||
@@ -429,7 +429,7 @@ export const Buttons = ({
|
|||||||
<AnimatedText
|
<AnimatedText
|
||||||
maxWidth={3}
|
maxWidth={3}
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.25}
|
fontSize={0.25}
|
||||||
outlineWidth={1 / 60}
|
outlineWidth={1 / 60}
|
||||||
fillOpacity={printerMenuSpring.opacity}
|
fillOpacity={printerMenuSpring.opacity}
|
||||||
@@ -440,7 +440,7 @@ export const Buttons = ({
|
|||||||
</Billboard>
|
</Billboard>
|
||||||
<Billboard position={[-5.5, 3.175, -3]}>
|
<Billboard position={[-5.5, 3.175, -3]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.25}
|
fontSize={0.25}
|
||||||
outlineWidth={1 / 60}
|
outlineWidth={1 / 60}
|
||||||
fillOpacity={printerMenuSpring.opacity}
|
fillOpacity={printerMenuSpring.opacity}
|
||||||
@@ -489,7 +489,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[2.845, 5.1875, 6.454]}>
|
<Billboard position={[2.845, 5.1875, 6.454]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.21875}
|
fontSize={0.21875}
|
||||||
outlineWidth={7 / 480}
|
outlineWidth={7 / 480}
|
||||||
fillOpacity={sideMenuSpring.opacity}
|
fillOpacity={sideMenuSpring.opacity}
|
||||||
@@ -537,7 +537,7 @@ export const Buttons = ({
|
|||||||
</animated.mesh>
|
</animated.mesh>
|
||||||
<Billboard position={[3.75, 5.515, 7]}>
|
<Billboard position={[3.75, 5.515, 7]}>
|
||||||
<AnimatedText
|
<AnimatedText
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
fontSize={0.21875}
|
fontSize={0.21875}
|
||||||
outlineWidth={7 / 480}
|
outlineWidth={7 / 480}
|
||||||
fillOpacity={sideMenuSpring.opacity}
|
fillOpacity={sideMenuSpring.opacity}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
|||||||
}
|
}
|
||||||
distanceFactor={10}
|
distanceFactor={10}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: "url(/static/pc-bg.webp)",
|
backgroundImage: "url(/assets/pc-bg.webp)",
|
||||||
backgroundColor: "#111535",
|
backgroundColor: "#111535",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -312,7 +312,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: "url('/static/cellphone-bg.webp')",
|
backgroundImage: "url('/assets/cellphone-bg.webp')",
|
||||||
backgroundColor: "black",
|
backgroundColor: "black",
|
||||||
}}
|
}}
|
||||||
distanceFactor={10}
|
distanceFactor={10}
|
||||||
@@ -384,7 +384,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
|||||||
</group>
|
</group>
|
||||||
<Text
|
<Text
|
||||||
position={[-2.415, 12.5, -6]}
|
position={[-2.415, 12.5, -6]}
|
||||||
font="/static/inter-bold.ttf"
|
font="/assets/inter-bold.ttf"
|
||||||
color="black"
|
color="black"
|
||||||
fontSize={3}
|
fontSize={3}
|
||||||
>
|
>
|
||||||
@@ -392,7 +392,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
|||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
position={[5.185, 12.5, 1.592]}
|
position={[5.185, 12.5, 1.592]}
|
||||||
font="/static/inter-bold.ttf"
|
font="/assets/inter-bold.ttf"
|
||||||
rotation={[0, -Math.PI / 2, 0]}
|
rotation={[0, -Math.PI / 2, 0]}
|
||||||
color="black"
|
color="black"
|
||||||
fontSize={3}
|
fontSize={3}
|
||||||
@@ -402,7 +402,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
|||||||
{config.status && (
|
{config.status && (
|
||||||
<Text
|
<Text
|
||||||
position={[5.185, 10, 1.592]}
|
position={[5.185, 10, 1.592]}
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
rotation={[0, -Math.PI / 2, 0]}
|
rotation={[0, -Math.PI / 2, 0]}
|
||||||
color="black"
|
color="black"
|
||||||
fontSize={0.75}
|
fontSize={0.75}
|
||||||
@@ -413,7 +413,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
|||||||
{config.location && (
|
{config.location && (
|
||||||
<Text
|
<Text
|
||||||
position={[5.185, 8.5, 1.592]}
|
position={[5.185, 8.5, 1.592]}
|
||||||
font="/static/inter.ttf"
|
font="/assets/inter.ttf"
|
||||||
rotation={[0, -Math.PI / 2, 0]}
|
rotation={[0, -Math.PI / 2, 0]}
|
||||||
color="black"
|
color="black"
|
||||||
fontSize={0.75}
|
fontSize={0.75}
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ import { prettify } from "awesome-ajv-errors";
|
|||||||
|
|
||||||
export async function register() {
|
export async function register() {
|
||||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||||
const fs = await import("fs");
|
|
||||||
|
|
||||||
const phoneRegex = /^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/;
|
const phoneRegex = /^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/;
|
||||||
|
|
||||||
const ajv = new Ajv({ allErrors: true });
|
const ajv = new Ajv({ allErrors: true });
|
||||||
@@ -84,14 +82,14 @@ export async function register() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const config = JSON.parse(
|
const { default: configParsed } = (await import(
|
||||||
fs.readFileSync("public/config/config.json", "utf-8")
|
"../public/config/config.json"
|
||||||
);
|
)) as unknown as { default: Config };
|
||||||
|
|
||||||
const validateConfig = ajv.compile(configSchema);
|
const validateConfig = ajv.compile(configSchema);
|
||||||
|
|
||||||
if (!validateConfig(config)) {
|
if (!validateConfig(configParsed)) {
|
||||||
console.error(prettify(validateConfig, { data: config }));
|
console.error(prettify(validateConfig, { data: configParsed }));
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user