fix: containers @ bootstrap

This commit is contained in:
cha0s 2024-02-01 14:55:54 -06:00
parent dcf48dab95
commit 378ddaf762
8 changed files with 12 additions and 9 deletions

View File

@ -1,4 +1,4 @@
export default (flecks) => {
module.exports = (flecks) => {
const {
dialect,
username,

View File

@ -0,0 +1,5 @@
const containers = require('./containers');
exports.hooks = {
'@flecks/docker.containers': containers,
};

View File

@ -1,7 +1,6 @@
import {Flecks} from '@flecks/core';
import {createDatabaseConnection} from './connection';
import containers from './containers';
import register from './register';
export {
@ -21,7 +20,6 @@ export const hooks = {
register(gathered, flecks.db.sequelize);
}
},
'@flecks/docker.containers': containers,
'@flecks/server.up': Flecks.priority(
async (flecks) => {
flecks.db.sequelize = await createDatabaseConnection(flecks);

View File

@ -75,7 +75,7 @@ export default async (flecks, key, config) => {
);
const child = spawn('docker', args, {
detached: true,
stdio: 'ignore',
// stdio: 'ignore',
});
await new Promise((r, e) => {
child.on('error', e);

View File

@ -1,4 +1,4 @@
export default (flecks) => ({
module.exports = (flecks) => ({
redis: {
environment: {
app: {

View File

@ -1,4 +1,6 @@
export const hooks = {
const containers = require('./containers');
exports.hooks = {
'@flecks/core.config': () => ({
/**
* Redis server host.
@ -9,4 +11,5 @@ export const hooks = {
*/
port: 6379,
}),
'@flecks/docker.containers': containers,
};

View File

@ -19,7 +19,6 @@
"access": "public"
},
"files": [
"index.js",
"session/server.js",
"server.js"
],

View File

@ -1,6 +1,5 @@
import {Flecks} from '@flecks/core';
import containers from './containers';
import createClient from './create-client';
export {default as redis} from 'redis';
@ -30,7 +29,6 @@ const safeKeys = async (client, pattern, caret) => {
export const keys = (client, pattern) => safeKeys(client, pattern, 0);
export const hooks = {
'@flecks/docker.containers': containers,
'@flecks/repl.context': async (flecks) => ({
redisClient: await createClient(flecks),
}),