I am playing around with the alpha watch experimental setup with the following to see if I can play with configuration changes or at the least understand how could watch feature work.
Setup
I have a standard run-of-the-mill container called node-red available from DockerHub nodered/node-red. The image is used out of the box and not through a Dockerfile with its respective settings mounted as config .
under nodered/settings.js the following content exists:
module.exports = {
flowFile: 'flows.json',
/** By default, credentials are encrypted in storage using a generated key. To
* specify your own secret, set the following property.
* If you want to disable encryption of credentials, set this property to false.
* Note: once you set this property, do not change it - doing so will prevent
* node-red from being able to decrypt your existing credentials and they will be
* lost.
*/
credentialSecret: "test",
/** By default, the flow JSON will be formatted over multiple lines making
* it easier to compare changes when using version control.
* To disable pretty-printing of the JSON set the following property to false.
*/
flowFilePretty: true,
/** To password protect the Node-RED editor and admin API, the following
* property can be used. See http://nodered.org/docs/security.html for details.
*/
adminAuth: {
type: "credentials",
users: [
{
username: "admin",
password: "$2b$08$vD9mLlYRTkJFTfmzqAD/Bea7a8wV53qGetUKWjOmHJlqmjvBc2xvS",
permissions: "*"
},{
username: "ro_user",
password: "$2b$08$TqtFcPpd6rtoaRrFeHnW/.DbKouK/LtS.PVzoa7VQzXFYuBupCBHS",
permissions: "read"
},
]
},
/** the tcp port that the Node-RED web server is listening on */
uiPort: 1880,
/** By default, the Node-RED UI is available at http://localhost:1880/
* The following property can be used to specify a different root path.
* If set to false, this is disabled.
*/
httpAdminRoot: '/nodered1',
/** Some nodes, such as HTTP In, can be used to listen for incoming http requests.
* By default, these are served relative to '/'. The following property
* can be used to specify a different root path. If set to false, this is
* disabled.
*/
httpNodeRoot: '/nodered',
/** Configure diagnostics options
* - enabled: When `enabled` is `true` (or unset), diagnostics data will
* be available at http://localhost:1880/diagnostics
* - ui: When `ui` is `true` (or unset), the action `show-system-info` will
* be available to logged in users of node-red editor
*/
diagnostics: {
/** enable or disable diagnostics endpoint. Must be set to `false` to disable */
enabled: true,
/** enable or disable diagnostics display in the node-red editor. Must be set to `false` to disable */
ui: true,
},
/** Configure runtimeState options
* - enabled: When `enabled` is `true` flows runtime can be Started/Stopped
* by POSTing to available at http://localhost:1880/flows/state
* - ui: When `ui` is `true`, the action `core:start-flows` and
* `core:stop-flows` will be available to logged in users of node-red editor
* Also, the deploy menu (when set to default) will show a stop or start button
*/
runtimeState: {
/** enable or disable flows/state endpoint. Must be set to `false` to disable */
enabled: true,
/** show or hide runtime stop/start options in the node-red editor. Must be set to `false` to hide */
ui: true,
},
/** The following property can be used to disable the editor. The admin API
* is not affected by this option. To disable both the editor and the admin
* API, use either the httpRoot or httpAdminRoot properties
*/
disableEditor: false,
/** Customising the editor
* See https://nodered.org/docs/user-guide/runtime/configuration#editor-themes
* for all available options.
*/
editorTheme: {
/** To disable the 'Welcome to Node-RED' tour that is displayed the first
* time you access the editor for each release of Node-RED, set this to false
*/
tours: false,
},
logging: {
console: {
level: "info"
},
},
/** Allow the Function node to load additional npm modules directly */
functionExternalModules: true,
/** If you installed the optional node-red-dashboard you can set it's path
* relative to httpNodeRoot
* Other optional properties include
* readOnly:{boolean},
* middleware:{function or array}, (req,res,next) - http middleware
* ioMiddleware:{function or array}, (socket,next) - socket.io middleware
*/
ui: { path: "ui" },
/** Colourise the console output of the debug node */
debugUseColors: true,
/** The maximum length, in characters, of any message sent to the debug sidebar tab */
debugMaxLength: 1000,
/** Maximum buffer size for the exec node. Defaults to 10Mb */
execMaxBufferSize: 10000000,
/** Timeout in milliseconds for HTTP request connections. Defaults to 120s */
httpRequestTimeout: 120000,
/** Retry time in milliseconds for MQTT connections */
mqttReconnectTime: 15000,
/** Retry time in milliseconds for Serial port connections */
serialReconnectTime: 15000,
}
On the slack channel #docker-compose @glours was kind enough to point out that the alpha watch feature is meant for a build based service with a dedicated Dockerfile, which is not the case here and I understand that maybe this Issue may not be valid for run-of-the-mill containers.
If so, please close this issue, if not I hope this issue helps solve a problem for the alpha watch feature not previously known.
Based on discussions with @ndeloof the current alpha spec for watch is meant for observation when build is part of the service and not for ready-to-use containers
Description
I am playing around with the
alpha watch
experimental setup with the following to see if I can play with configuration changes or at the least understand how couldwatch
feature work.Setup
I have a standard run-of-the-mill container called
node-red
available from DockerHubnodered/node-red
. The image is used out of the box and not through aDockerfile
with its respective settings mounted asconfig
.Compose File
docker-compose.nodered.yml
settings.js
mounted as Docker Configunder
nodered/settings.js
the following content exists:FileSystem Structure
Steps To Reproduce
For the filesystem structure above perform the following:
The container is brought up but the watch breaks with a panic
Compose Version
Docker Environment
Anything else?
Note
On the slack channel
#docker-compose
@glours was kind enough to point out that thealpha watch
feature is meant for abuild
based service with a dedicatedDockerfile
, which is not the case here and I understand that maybe this Issue may not be valid for run-of-the-mill containers.If so, please close this issue, if not I hope this issue helps solve a problem for the
alpha watch
feature not previously known.