This commit is contained in:
vchikalkin 2023-01-10 20:49:34 +03:00
parent cd4d87de91
commit e08174d59f
4 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,7 @@ RUN apk update
# Set working directory
WORKDIR /app
RUN yarn global add turbo
RUN yarn global add dotenv-cli
COPY . .
RUN turbo prune --scope=web --docker
@ -26,7 +27,8 @@ RUN yarn install
# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
RUN yarn turbo run build --filter=web...
COPY .env .env
RUN yarn dotenv -e .env turbo run build --filter=web...
FROM node:alpine AS runner
WORKDIR /app

View File

@ -1,8 +1,13 @@
/* eslint-disable import/prefer-default-export */
import { publicRuntimeConfigSchema } from 'config/schema/runtime-config';
import getConfig from 'next/config';
import type { User } from './types';
const { publicRuntimeConfig } = getConfig();
const { USERS_SUPER } = publicRuntimeConfigSchema.parse(publicRuntimeConfig);
export function love(user: User) {
const superUsers: string[] = JSON.parse(process.env.USERS_SUPER || '');
const superUsers: string[] = JSON.parse(USERS_SUPER);
// eslint-disable-next-line no-param-reassign
if (superUsers?.includes(user.username)) user.displayName += '🧡';

View File

@ -8,6 +8,7 @@ const envSchema = z.object({
.transform((val) => !!val),
PORT: z.string().optional(),
BASE_PATH: z.string().optional().default(''),
USERS_SUPER: z.string().optional().default(''),
URL_CRM_GRAPHQL_DIRECT: z.string(),
URL_GET_USER_DIRECT: z.string(),
URL_CORE_FINGAP_DIRECT: z.string(),

View File

@ -4,6 +4,7 @@ const envSchema = require('./env');
const publicRuntimeConfigSchema = envSchema.pick({
BASE_PATH: true,
USE_DEV_COLORS: true,
USERS_SUPER: true,
});
const serverRuntimeConfigSchema = envSchema.pick({