2 Commits
Author SHA1 Message Date
dimitar 5262e73a12 cms fix 2026-02-24 18:02:03 +01:00
dimitar 590a96e502 fix: correct Strapi database configuration structure
The database config had an incorrect nested structure with
connection.client.connection which caused Strapi to fail with
'Cannot destructure property client of db.config.connection'.

Fixed to use the correct flat structure:
connection.client, connection.host, etc.
2026-02-24 18:01:30 +01:00
2 changed files with 10 additions and 14 deletions

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ RUN addgroup -g 1001 -S nodejs && \
# Copy built application from builder stage
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
COPY --from=builder --chown=nodejs:nodejs /app/config ./config
COPY --from=builder --chown=nodejs:nodejs /app/dist/config ./config
COPY --from=builder --chown=nodejs:nodejs /app/public ./public
COPY --from=builder --chown=nodejs:nodejs /app/favicon.png ./favicon.png
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
+9 -13
View File
@@ -11,15 +11,13 @@ export default ({ env }) => {
if (client === 'postgres') {
return {
connection: {
client,
connection: {
host: env('DATABASE_HOST', 'localhost'),
port: env.int('DATABASE_PORT', 5432),
database: env('DATABASE_NAME', 'strapi'),
user: env('DATABASE_USERNAME', 'strapi'),
password: env('DATABASE_PASSWORD', 'strapi'),
ssl: env.bool('DATABASE_SSL', false),
},
client: 'postgres',
host: env('DATABASE_HOST', 'localhost'),
port: env.int('DATABASE_PORT', 5432),
database: env('DATABASE_NAME', 'strapi'),
user: env('DATABASE_USERNAME', 'strapi'),
password: env('DATABASE_PASSWORD', 'strapi'),
ssl: env.bool('DATABASE_SSL', false),
pool: { min: 2, max: 10 },
},
};
@@ -27,10 +25,8 @@ export default ({ env }) => {
return {
connection: {
client,
connection: {
filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
client: 'sqlite',
filename: path.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')),
useNullAsDefault: true,
},
};