diff --git a/examples/nodeproj/README.md b/examples/nodeproj/README.md index 55878ae..5e87f5a 100644 --- a/examples/nodeproj/README.md +++ b/examples/nodeproj/README.md @@ -3,7 +3,12 @@ ``` -cp example.env local.env +cp example.local.env local.env +cp example.env .env +cat local.env +cat .env +echo "UID=$UID" >> .env +cat .env podman-compose build podman-compose run --rm --no-deps init podman-compose up diff --git a/examples/nodeproj/docker-compose.yml b/examples/nodeproj/docker-compose.yml index b7efa02..a295a08 100644 --- a/examples/nodeproj/docker-compose.yml +++ b/examples/nodeproj/docker-compose.yml @@ -14,7 +14,8 @@ services: - /run init: read_only: true - userns_mode: keep-id + #userns_mode: keep-id + user: ${UID:-1000} build: context: ./containers/${NODE_IMG:-node16-runtime} image: ${NODE_IMG:-node16-runtime} diff --git a/examples/nodeproj/example.env b/examples/nodeproj/example.env index 64703d0..6779df9 100644 --- a/examples/nodeproj/example.env +++ b/examples/nodeproj/example.env @@ -1,2 +1,3 @@ -REDIS_HOST=redis +WEB_LISTEN_PORT=3000 +# pass UID= your IDE user diff --git a/examples/nodeproj/lib/commands/task.js b/examples/nodeproj/lib/commands/task.js index d3abe45..62e5ef9 100644 --- a/examples/nodeproj/lib/commands/task.js +++ b/examples/nodeproj/lib/commands/task.js @@ -8,9 +8,9 @@ async function loop() { try { task_desc = JSON.parse(task_desc_s); } catch (e) { - proj.logger.exception(e); + console.exception(e); } - proj.logger.info("got task "+task_desc.func); + console.info("got task "+task_desc.func); const func = task_desc.func; const args = task_desc.args; if (typeof(proj.tasks[func])!="function") { diff --git a/examples/nodeproj/lib/commands/web.js b/examples/nodeproj/lib/commands/web.js index b05dabd..8441577 100644 --- a/examples/nodeproj/lib/commands/web.js +++ b/examples/nodeproj/lib/commands/web.js @@ -7,7 +7,6 @@ import express from "express"; export async function start() { const app = express(); - app.use(proj.logger.express_logger); const server = http.createServer(app); // Routing @@ -17,6 +16,6 @@ export async function start() { }); server.listen(proj.config.LISTEN_PORT, proj.config.LISTEN_HOST, function() { - proj.logger.warn(`listening at port ${proj.config.LISTEN_PORT}`); + console.warn(`listening at port ${proj.config.LISTEN_PORT}`); }); } diff --git a/examples/nodeproj/package.json b/examples/nodeproj/package.json index 5e11d5b..9b9b879 100644 --- a/examples/nodeproj/package.json +++ b/examples/nodeproj/package.json @@ -9,7 +9,7 @@ "main": "index.js", "type": "module", "scripts": { - "cli": "nodemon -w lib -w index.js --es-module-specifier-resolution=node ./index.mjs" + "cli": "nodemon -w lib -w index.js --es-module-specifier-resolution=node ./index.js" }, "dependencies": { "express": "~4.16.4", diff --git a/podman_compose.py b/podman_compose.py index 618e3c3..54a1ba7 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1167,6 +1167,9 @@ def rec_merge_one(target, source): if key not in source: continue value2 = source[key] + if key == "command": + target[key] = value2 + continue if not isinstance(value2, type(value)): value_type = type(value) value2_type = type(value2)