Repository navigation
Expand file tree
/
Copy pathdevcontainer.json
More file actions
34 lines (34 loc) · 1.75 KB
/
Copy pathdevcontainer.json
File metadata and controls
34 lines (34 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// CodeLead's own development environment — used two ways:
// * a human: VS Code "Reopen in Container" (or any devcontainer client)
// * CodeLead itself: point an instance at this repo, enable Devcontainer
// execution, and tasks run in here (preview: any free port, e.g. 4001,
// command `PORT="$PREVIEW_PORT" mix phx.server`).
// Running the full app *inside* this container with container execution
// enabled additionally needs the workspace root host-coincident — bind
// the same host directory at the identical path and point WORKSPACE_ROOT
// at it (docs/deployment.md, "The data directory"); otherwise container
// tasks refuse to start. Agents running `mix test` /
// `mix phx.server` need nothing extra — docker-dependent tests are
// excluded by default.
{
"name": "CodeLead",
"dockerComposeFile": "compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"remoteUser": "dev",
"forwardPorts": [4000],
"portsAttributes": {
"4000": { "label": "CodeLead (mix phx.server)" }
},
// deps + create/migrate/seed the dev DB + tailwind/esbuild standalone
// binaries (no Node). Seeds the admin login, so a preview is usable
// immediately. Cheap: the Dockerfile already prewarmed deps and the
// asset binaries into the image, so this reconciles a delta and
// compiles the app.
"postCreateCommand": "mix setup",
// Runs on every start, not only on creation: catches migrations the
// branch gained mid-task and a container restarted after the instance
// was. Deliberately non-fatal — a bad migration must not lock you out
// of the Terminal you would fix it from.
"postStartCommand": "mix deps.get && mix ecto.create --quiet && mix ecto.migrate || echo 'devcontainer: setup failed — run mix ecto.migrate by hand'"
}