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
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Script to create Strapi API token via command line
|
||||
# Run this on the VPS: ssh root@109.199.109.108 "bash -s" < create-strapi-token.sh
|
||||
|
||||
echo "Creating Strapi API token..."
|
||||
|
||||
# Execute inside the CMS container
|
||||
docker exec placebo-cms node -e "
|
||||
const strapi = require('@strapi/strapi');
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const app = await strapi.createStrapi().load();
|
||||
|
||||
const tokenService = app.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,
|
||||
});
|
||||
|
||||
console.log('\n✅ API Token created successfully!');
|
||||
console.log('\nCopy this token to Coolify as STRAPI_API_TOKEN:');
|
||||
console.log(token.accessKey);
|
||||
console.log('');
|
||||
|
||||
process.exit(0);
|
||||
} catch (error) {
|
||||
console.error('❌ Error:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
})();
|
||||
"
|
||||
Reference in new issue
Block a user