flecks/packages/docker/build/flecks.hooks.js

43 lines
997 B
JavaScript
Raw Normal View History

export const hooks = {
/**
* Define docker containers.
*
2024-01-29 08:15:22 -06:00
* @invoke MergeUniqueAsync
*/
'@flecks/docker.containers': () => ({
someContainer: {
// Environment variables.
environment: {
SOME_CONTAINER_VAR: 'hello',
2022-03-07 00:21:16 -06:00
},
// The docker image.
image: 'some-image:latest',
// Some container path you'd like to persist. Flecks handles the host path.
mount: '/some/container/path',
// Expose ports.
ports: {3000: 3000},
},
}),
2022-03-07 00:21:16 -06:00
2023-12-10 14:23:12 -06:00
/**
*
* @param {string} dockerfile The content of the Dockerfile.
*
* @returns The new content of the Dockerfile.
2024-01-29 08:15:22 -06:00
* @invoke ComposedAsync
2023-12-10 14:23:12 -06:00
*/
'@flecks/docker.Dockerfile': (dockerfile) => (
dockerfile.replace('DEBUG=*', 'DEBUG=*,-*:silly')
),
/**
*
* @param {Object} config The object representing the docker compose configuration.
2024-01-29 08:15:22 -06:00
* @invoke SequentialAsync
2023-12-10 14:23:12 -06:00
*/
'@flecks/docker.docker-compose.yml': (config) => {
config.version = '3.1';
},
};