This commit is contained in:
@@ -27,6 +27,9 @@ ENV JWT_SECRET=secret
|
||||
ENV ADMIN_JWT_SECRET=secret
|
||||
ENV APP_KEYS=secret
|
||||
|
||||
# Optionally set a default value for ALLOWED_HOSTS
|
||||
ENV ALLOWED_HOSTS=localhost
|
||||
|
||||
# No need to build in development mode
|
||||
|
||||
EXPOSE 1337
|
||||
|
||||
@@ -15,6 +15,7 @@ services:
|
||||
ADMIN_JWT_SECRET: d9cqEottMoABxcmp
|
||||
APP_KEYS: szkCL5n0Mwyqo6ef
|
||||
API_TOKEN_SALT: pMJRhpA4J+zUHzJO
|
||||
ALLOWED_HOSTS: "localhost,127.0.0.1"
|
||||
ports:
|
||||
- "1337:1337"
|
||||
depends_on:
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { mergeConfig, type UserConfig } from 'vite';
|
||||
|
||||
export default (config: UserConfig) => {
|
||||
// Important: always return the modified config
|
||||
return mergeConfig(config, {
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': '/src',
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import { mergeConfig, type UserConfig } from "vite";
|
||||
|
||||
export default (config: UserConfig) => {
|
||||
// Read ALLOWED_HOSTS from environment and inject as VITE_ALLOWED_HOSTS
|
||||
const allowedHosts = process.env.ALLOWED_HOSTS || "localhost";
|
||||
|
||||
return mergeConfig(config, {
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": "/src",
|
||||
},
|
||||
},
|
||||
define: {
|
||||
"import.meta.env.VITE_ALLOWED_HOSTS": JSON.stringify(allowedHosts),
|
||||
},
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user