A Node.js web service with MySQL and Redis, described in a normal compose.yml that wip
parses itself — no third-party compose-for-wslc tool required. See
Compose Native Mode for how this
differs from mode: compose.
compose.yml—web,db(MySQL), andcache(Redis) services, with ahealthcheck:ondbthatwip upwaits on before startingwebwip.yml— points at thewebservice and adds a few day-to-day commandsDockerfile.dev— a minimal placeholder image sowip buildhas something to run; replace it with your app's real Dockerfile. It runs as the image's non-rootnodeuser sonpm installdoesn't leave root-owned files in the bind-mounted/app.
The
root/passwordMySQL credential here is for local development only.dbpublishes127.0.0.1:3306so it stays on the loopback interface rather than every host interface. Swap in a real secret (and a non-root database user) before running this anywhere shared or reachable.
-
Copy
compose.yml,wip.yml, andDockerfile.devinto the root of your Node app (or pointcompose.yml'sbuild.dockerfileat your own). -
Adjust
MYSQL_DATABASE/DATABASE_URLif your app uses a different database name. -
Run the checks:
wip doctor wip build wip up -dwip up -dwaits fordb'shealthcheck:to pass (depends_on: condition: service_healthy) before startingweb. -
Everyday commands:
wip npm install wip test wip mysql # opens the mysql client against the db service wip redis-cli # opens redis-cli against the cache service wip shell
-
wip logs web(or any service name) follows that service's logs undermode: compose-native;wip downstops and removes the whole stack.
See the Configuration Reference and the compose.yml service-key table in the main README for which Compose keys are read.