fix: use internal Docker network for backend-to-CMS communication
- Changed STRAPI_URL from https://cms.placebo.mk to http://cms:1337 - Added cms dependency to backend service - This fixes Gateway Timeout errors when backend tries to fetch from Strapi - Enables proper container-to-container communication
This commit is contained in:
1 parent
4f30542014
commit
c1b49a4cb6
5 files changed
+80
-1
No files matched your search
@@ -0,0 +1 @@
|
||||
ad31a55be0b5efc2d6d7b5490e8d1a31b1a3a2aecbcf99e8f65bcb44bd0189e2918388b942fb3ac7b35fd470d19d475e556489b773c68756977e452aec1ab83f34876ed76ebadafce31636d5621c66820425d1105d753cdc5452d8f3d503ddbaebf45fc6817c235e1f8eae12d118452951ee0a48691446475f7ffc6a72fd6ffb
|
||||
@@ -0,0 +1,2 @@
|
||||
api token=5af45b836a0bcd065b528963e62b6d5d325117dfbf179cd5123087a17906c911fd67bcb57d92f11e869ebda27339b21aa3a7221d3dbbe79de51ef2f9e2af4dae0befe6528872ca2f68f64656ed45c7dfcacea36fdb55d1d9eb2fd9275454ac7ff8ab9acb1535f62449b3f8bd75c24803a2bd0714c637fd1d0bc819798723d999
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Script to create an API token for backend integration
|
||||
* Run this inside the CMS container if the UI doesn't work
|
||||
*/
|
||||
|
||||
import { factories } from '@strapi/strapi';
|
||||
|
||||
async function createApiToken() {
|
||||
const strapi = await factories.createCoreStore()();
|
||||
|
||||
try {
|
||||
// Create API token
|
||||
const tokenService = strapi.service('admin::api-token');
|
||||
|
||||
const token = await tokenService.create({
|
||||
name: 'Backend Integration',
|
||||
description: 'Token for backend to fetch articles',
|
||||
type: 'read-only',
|
||||
permissions: [],
|
||||
lifespan: null, // Unlimited
|
||||
});
|
||||
|
||||
console.log('✅ API Token created successfully!');
|
||||
console.log('\nToken details:');
|
||||
console.log('Name:', token.name);
|
||||
console.log('Type:', token.type);
|
||||
console.log('\nTOKEN (copy this to Coolify as STRAPI_API_TOKEN):');
|
||||
console.log(token.accessKey);
|
||||
console.log('\n⚠️ Save this token - you won\'t see it again!');
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error creating API token:', error.message);
|
||||
} finally {
|
||||
await strapi.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
createApiToken();
|
||||
Reference in new issue
Block a user