mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-13 17:05:47 +01:00
🐛 Fix database for docker container
This commit is contained in:
@@ -4,7 +4,6 @@ echo "Exporting hostname..."
|
|||||||
export NEXTAUTH_URL_INTERNAL="http://$HOSTNAME:7575"
|
export NEXTAUTH_URL_INTERNAL="http://$HOSTNAME:7575"
|
||||||
|
|
||||||
echo "Pushing database changes..."
|
echo "Pushing database changes..."
|
||||||
npm config set update-notifier false
|
|
||||||
prisma db push --skip-generate
|
prisma db push --skip-generate
|
||||||
|
|
||||||
echo "Starting production server..."
|
echo "Starting production server..."
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const env = createEnv({
|
|||||||
),
|
),
|
||||||
DOCKER_HOST: z.string().optional(),
|
DOCKER_HOST: z.string().optional(),
|
||||||
DOCKER_PORT: portSchema,
|
DOCKER_PORT: portSchema,
|
||||||
|
HOSTNAME: z.string().optional()
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,6 +57,7 @@ const env = createEnv({
|
|||||||
NEXT_PUBLIC_DEFAULT_COLOR_SCHEME: process.env.DEFAULT_COLOR_SCHEME,
|
NEXT_PUBLIC_DEFAULT_COLOR_SCHEME: process.env.DEFAULT_COLOR_SCHEME,
|
||||||
NEXT_PUBLIC_PORT: process.env.PORT,
|
NEXT_PUBLIC_PORT: process.env.PORT,
|
||||||
NEXT_PUBLIC_NODE_ENV: process.env.NODE_ENV,
|
NEXT_PUBLIC_NODE_ENV: process.env.NODE_ENV,
|
||||||
|
HOSTNAME: process.env.HOSTNAME
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ const getTrpcConfiguration = () => ({
|
|||||||
|
|
||||||
const getBaseUrl = () => {
|
const getBaseUrl = () => {
|
||||||
if (typeof window !== 'undefined') return ''; // browser should use relative url
|
if (typeof window !== 'undefined') return ''; // browser should use relative url
|
||||||
|
if (env.HOSTNAME) {
|
||||||
|
console.log('Constructing internal hostname address using', env.HOSTNAME, env.NEXT_PUBLIC_PORT);
|
||||||
|
return `http://${env.HOSTNAME}:${env.NEXT_PUBLIC_PORT}`;
|
||||||
|
}
|
||||||
return `http://localhost:${env.NEXT_PUBLIC_PORT ?? 3000}`; // dev SSR should use localhost
|
return `http://localhost:${env.NEXT_PUBLIC_PORT ?? 3000}`; // dev SSR should use localhost
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user