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 base
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
FROM node:lts-alpine AS deps
|
||||
WORKDIR /app
|
||||
|
||||
RUN corepack enable \
|
||||
&& corepack prepare yarn@4.9.1 --activate
|
||||
|
||||
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
|
||||
|
||||
RUN corepack enable && corepack prepare yarn@4.9.1 --activate
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
RUN yarn install --immutable
|
||||
FROM node:lts-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/package.json ./
|
||||
COPY --from=builder /app/yarn.lock* ./
|
||||
COPY --from=builder /app/package-lock.json* ./
|
||||
COPY --from=builder /app/pnpm-lock.yaml* ./
|
||||
|
||||
RUN corepack enable \
|
||||
&& 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
|
||||
RUN corepack enable && corepack prepare yarn@4.9.1 --activate \
|
||||
&& addgroup -S nodejs -g 1001 \
|
||||
&& adduser -S nextjs -u 1001
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY --from=deps /app/package.json ./package.json
|
||||
COPY . .
|
||||
RUN chown -R nextjs:nodejs /app
|
||||
USER nextjs
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
ENTRYPOINT ["sh","-c","\
|
||||
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 && node server.js"]
|
||||
ENV NODE_ENV=production \
|
||||
NEXT_TELEMETRY_DISABLED=1 \
|
||||
PORT=3000
|
||||
EXPOSE 3000
|
||||
CMD ["sh", "-c", "yarn build && yarn start -p $PORT"]
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
output: "standalone",
|
||||
};
|
||||
const nextConfig: 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>
|
||||
<Billboard position={[0.9, 8.5, 1.65]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.75}
|
||||
outlineWidth={0.05}
|
||||
fillOpacity={mainMenuSpring.opacity}
|
||||
@@ -228,7 +228,7 @@ export const Buttons = ({
|
||||
</animated.mesh>
|
||||
<Billboard position={[-5.5, 7.5, -2]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.75}
|
||||
outlineWidth={0.05}
|
||||
fillOpacity={mainMenuSpring.opacity}
|
||||
@@ -271,7 +271,7 @@ export const Buttons = ({
|
||||
</animated.mesh>
|
||||
<Billboard position={[2.525, 7.5, 6.75]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.75}
|
||||
outlineWidth={0.05}
|
||||
fillOpacity={mainMenuSpring.opacity}
|
||||
@@ -320,7 +320,7 @@ export const Buttons = ({
|
||||
</animated.mesh>
|
||||
<Billboard position={[2.358, 5.75, -2.055]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.3125}
|
||||
outlineWidth={1 / 48}
|
||||
fillOpacity={desktopMenuSpring.opacity}
|
||||
@@ -366,7 +366,7 @@ export const Buttons = ({
|
||||
</animated.mesh>
|
||||
<Billboard position={[3.25, 6.607, 1.668]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.3125}
|
||||
outlineWidth={1 / 48}
|
||||
fillOpacity={desktopMenuSpring.opacity}
|
||||
@@ -416,7 +416,7 @@ export const Buttons = ({
|
||||
<Billboard position={[-3.25, 6.65, -2.75]}>
|
||||
<AnimatedText
|
||||
maxWidth={4.5}
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.25}
|
||||
outlineWidth={1 / 60}
|
||||
fillOpacity={printerMenuSpring.opacity}
|
||||
@@ -429,7 +429,7 @@ export const Buttons = ({
|
||||
<AnimatedText
|
||||
maxWidth={3}
|
||||
textAlign="center"
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.25}
|
||||
outlineWidth={1 / 60}
|
||||
fillOpacity={printerMenuSpring.opacity}
|
||||
@@ -440,7 +440,7 @@ export const Buttons = ({
|
||||
</Billboard>
|
||||
<Billboard position={[-5.5, 3.175, -3]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.25}
|
||||
outlineWidth={1 / 60}
|
||||
fillOpacity={printerMenuSpring.opacity}
|
||||
@@ -489,7 +489,7 @@ export const Buttons = ({
|
||||
</animated.mesh>
|
||||
<Billboard position={[2.845, 5.1875, 6.454]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.21875}
|
||||
outlineWidth={7 / 480}
|
||||
fillOpacity={sideMenuSpring.opacity}
|
||||
@@ -537,7 +537,7 @@ export const Buttons = ({
|
||||
</animated.mesh>
|
||||
<Billboard position={[3.75, 5.515, 7]}>
|
||||
<AnimatedText
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
fontSize={0.21875}
|
||||
outlineWidth={7 / 480}
|
||||
fillOpacity={sideMenuSpring.opacity}
|
||||
|
||||
@@ -225,7 +225,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
||||
}
|
||||
distanceFactor={10}
|
||||
style={{
|
||||
backgroundImage: "url(/static/pc-bg.webp)",
|
||||
backgroundImage: "url(/assets/pc-bg.webp)",
|
||||
backgroundColor: "#111535",
|
||||
}}
|
||||
>
|
||||
@@ -312,7 +312,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
||||
: undefined
|
||||
}
|
||||
style={{
|
||||
backgroundImage: "url('/static/cellphone-bg.webp')",
|
||||
backgroundImage: "url('/assets/cellphone-bg.webp')",
|
||||
backgroundColor: "black",
|
||||
}}
|
||||
distanceFactor={10}
|
||||
@@ -384,7 +384,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
||||
</group>
|
||||
<Text
|
||||
position={[-2.415, 12.5, -6]}
|
||||
font="/static/inter-bold.ttf"
|
||||
font="/assets/inter-bold.ttf"
|
||||
color="black"
|
||||
fontSize={3}
|
||||
>
|
||||
@@ -392,7 +392,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
||||
</Text>
|
||||
<Text
|
||||
position={[5.185, 12.5, 1.592]}
|
||||
font="/static/inter-bold.ttf"
|
||||
font="/assets/inter-bold.ttf"
|
||||
rotation={[0, -Math.PI / 2, 0]}
|
||||
color="black"
|
||||
fontSize={3}
|
||||
@@ -402,7 +402,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
||||
{config.status && (
|
||||
<Text
|
||||
position={[5.185, 10, 1.592]}
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
rotation={[0, -Math.PI / 2, 0]}
|
||||
color="black"
|
||||
fontSize={0.75}
|
||||
@@ -413,7 +413,7 @@ export function Scene(props: JSX.IntrinsicElements["group"]) {
|
||||
{config.location && (
|
||||
<Text
|
||||
position={[5.185, 8.5, 1.592]}
|
||||
font="/static/inter.ttf"
|
||||
font="/assets/inter.ttf"
|
||||
rotation={[0, -Math.PI / 2, 0]}
|
||||
color="black"
|
||||
fontSize={0.75}
|
||||
|
||||
@@ -5,8 +5,6 @@ import { prettify } from "awesome-ajv-errors";
|
||||
|
||||
export async function register() {
|
||||
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 ajv = new Ajv({ allErrors: true });
|
||||
@@ -84,14 +82,14 @@ export async function register() {
|
||||
},
|
||||
};
|
||||
|
||||
const config = JSON.parse(
|
||||
fs.readFileSync("public/config/config.json", "utf-8")
|
||||
);
|
||||
const { default: configParsed } = (await import(
|
||||
"../public/config/config.json"
|
||||
)) as unknown as { default: Config };
|
||||
|
||||
const validateConfig = ajv.compile(configSchema);
|
||||
|
||||
if (!validateConfig(config)) {
|
||||
console.error(prettify(validateConfig, { data: config }));
|
||||
if (!validateConfig(configParsed)) {
|
||||
console.error(prettify(validateConfig, { data: configParsed }));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user