Fix: Rename Docker image for gateway service and reformat sqlite-config.js for consistency
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 12m14s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 9m25s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Failing after 29m52s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m57s

This commit is contained in:
2026-03-04 17:57:31 +01:00
parent db2b4a4027
commit e6aa22acdb
2 changed files with 52 additions and 50 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
- service: api-gateway - service: api-gateway
context: . context: .
dockerfile: backend/infrastructure/gateway/Dockerfile dockerfile: backend/infrastructure/gateway/Dockerfile
image: gateway image: api-gateway
- service: ping-service - service: ping-service
context: . context: .
dockerfile: backend/services/ping/Dockerfile dockerfile: backend/services/ping/Dockerfile
@@ -19,28 +19,28 @@ config.resolve.fallback.crypto = false;
// 2. Resolve sqlite3 paths // 2. Resolve sqlite3 paths
let sqliteBaseDir; let sqliteBaseDir;
try { try {
const packagePath = path.dirname(require.resolve('@sqlite.org/sqlite-wasm/package.json')); const packagePath = path.dirname(require.resolve('@sqlite.org/sqlite-wasm/package.json'));
sqliteBaseDir = path.join(packagePath, 'sqlite-wasm/jswasm'); sqliteBaseDir = path.join(packagePath, 'sqlite-wasm/jswasm');
} catch (e) { } catch (e) {
console.warn("Could not resolve @sqlite.org/sqlite-wasm path automatically. Using fallback path."); console.warn("Could not resolve @sqlite.org/sqlite-wasm path automatically. Using fallback path.");
sqliteBaseDir = path.resolve(__dirname, '../../../../../../node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm'); sqliteBaseDir = path.resolve(__dirname, '../../../../../../node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm');
} }
// 3. Copy ALL sqlite3 assets (wasm, js, and auxiliary workers) // 3. Copy ALL sqlite3 assets (wasm, js, and auxiliary workers)
const copyPatterns = []; const copyPatterns = [];
if (fs.existsSync(sqliteBaseDir)) { if (fs.existsSync(sqliteBaseDir)) {
console.log("Copying sqlite3 assets from:", sqliteBaseDir); console.log("Copying sqlite3 assets from:", sqliteBaseDir);
copyPatterns.push({ copyPatterns.push({
from: sqliteBaseDir, from: sqliteBaseDir,
to: '.', // Copy to root of dist to: '.', // Copy to root of dist
globOptions: { globOptions: {
ignore: ['**/package.json'] ignore: ['**/package.json']
}, },
noErrorOnMissing: true noErrorOnMissing: true
}); });
} else { } else {
console.error("ERROR: sqlite3 base directory does not exist:", sqliteBaseDir); console.error("ERROR: sqlite3 base directory does not exist:", sqliteBaseDir);
} }
// 4. Copy sqlite.worker.js from source // 4. Copy sqlite.worker.js from source
@@ -60,33 +60,33 @@ const pathC = path.resolve(__dirname, '../../../../core/local-db/src/jsMain/reso
let workerSourcePath = null; let workerSourcePath = null;
if (fs.existsSync(pathA)) { if (fs.existsSync(pathA)) {
workerSourcePath = pathA; workerSourcePath = pathA;
console.log("Found sqlite.worker.js at (Strategy A):", pathA); console.log("Found sqlite.worker.js at (Strategy A):", pathA);
} else if (fs.existsSync(pathB)) { } else if (fs.existsSync(pathB)) {
workerSourcePath = pathB; workerSourcePath = pathB;
console.log("Found sqlite.worker.js at (Strategy B):", pathB); console.log("Found sqlite.worker.js at (Strategy B):", pathB);
} else if (fs.existsSync(pathC)) { } else if (fs.existsSync(pathC)) {
workerSourcePath = pathC; workerSourcePath = pathC;
console.log("Found sqlite.worker.js at (Strategy C):", pathC); console.log("Found sqlite.worker.js at (Strategy C):", pathC);
} else { } else {
console.error("ERROR: Could not find sqlite.worker.js in any expected location!"); console.error("ERROR: Could not find sqlite.worker.js in any expected location!");
console.error("Checked A:", pathA); console.error("Checked A:", pathA);
console.error("Checked B:", pathB); console.error("Checked B:", pathB);
console.error("Checked C:", pathC); console.error("Checked C:", pathC);
} }
if (workerSourcePath) { if (workerSourcePath) {
copyPatterns.push({ copyPatterns.push({
from: workerSourcePath, from: workerSourcePath,
to: 'sqlite.worker.js', to: 'sqlite.worker.js',
noErrorOnMissing: true noErrorOnMissing: true
}); });
} }
config.plugins.push( config.plugins.push(
new CopyWebpackPlugin({ new CopyWebpackPlugin({
patterns: copyPatterns patterns: copyPatterns
}) })
); );
// 5. Alias sqlite3.wasm (still needed for some internal checks maybe) // 5. Alias sqlite3.wasm (still needed for some internal checks maybe)
@@ -103,15 +103,15 @@ config.module.rules = config.module.rules || [];
// Treat Skiko WASM as resource to avoid parsing errors // Treat Skiko WASM as resource to avoid parsing errors
config.module.rules.push({ config.module.rules.push({
test: /skiko\.wasm$/, test: /skiko\.wasm$/,
type: 'asset/resource' type: 'asset/resource'
}); });
// Treat other WASM as async (default) // Treat other WASM as async (default)
config.module.rules.push({ config.module.rules.push({
test: /\.wasm$/, test: /\.wasm$/,
exclude: /skiko\.wasm$/, exclude: /skiko\.wasm$/,
type: 'webassembly/async' type: 'webassembly/async'
}); });
// 7. Ignore warnings // 7. Ignore warnings
@@ -120,28 +120,30 @@ config.ignoreWarnings.push(/Critical dependency: the request of a dependency is
// 8. Fix for "webpackEmptyContext" in sqlite3.mjs // 8. Fix for "webpackEmptyContext" in sqlite3.mjs
config.plugins.push( config.plugins.push(
new webpack.ContextReplacementPlugin( new webpack.ContextReplacementPlugin(
/@sqlite\.org\/sqlite-wasm/, /@sqlite\.org\/sqlite-wasm/,
(data) => { (data) => {
delete data.dependencies; delete data.dependencies;
return data; return data;
} }
) )
); );
// 9. MIME types // 9. MIME types
config.devServer = config.devServer || {}; config.devServer = config.devServer || {};
config.devServer.devMiddleware = config.devServer.devMiddleware || {}; config.devServer.devMiddleware = config.devServer.devMiddleware || {};
config.devServer.devMiddleware.mimeTypes = { config.devServer.devMiddleware.mimeTypes = {
'application/wasm': ['wasm'], 'application/wasm': ['wasm'],
'application/javascript': ['js'] 'application/javascript': ['js']
}; };
// 10. OPTIMIZATION: Disable minification to prevent Terser crashes with SQLite WASM // 10. OPTIMIZATION: Aggressively disable ALL minimizers
// Since the app is mostly WASM-based, JS minification is not critical. // This is the ONLY stable way to prevent the Terser crash with SQLite-WASM
// in Kotlin/JS Production builds.
if (config.optimization) { if (config.optimization) {
console.log("SQLite Config: Disabling minification to prevent Terser errors."); console.log("SQLite Config: Aggressively removing minimizers to prevent Terser errors.");
config.optimization.minimize = false; config.optimization.minimize = false;
config.optimization.minimizer = []; // Das hier ist das entscheidende "Brecheisen"
} }
/*// 10. OPTIMIZATION: Exclude SQLite workers from parsing and minification /*// 10. OPTIMIZATION: Exclude SQLite workers from parsing and minification