dev/start.ts was checked by hand: musique starting alone on a fresh database, an unknown name refused, a taken port stopping both servers, and Ctrl+C or SIGTERM leaving no server behind. The compose project couldn't be run here (no Docker in the workspace): its YAML parses and resolves as intended, but it is untested; tsc, eslint, deno check, deno fmt, deno lint and doc:lint, which now covers dev/, are clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
# The dev environment: the workspace VS Code attaches to (`dev`), and one
|
|
# service per dev instance of gerbeur (dev/instances.ts), which start with it.
|
|
# Each instance service runs dev/start.ts for its own instance, which derives
|
|
# its ports, URLs, database and uploads from its entry there; a new instance is
|
|
# an entry there and a service here.
|
|
#
|
|
# Every service shares the host's network, as the workspace always did: an
|
|
# instance's URLs are localhost ones, which the browser and the other
|
|
# instances' servers must both reach.
|
|
#
|
|
# From the workspace's terminal (docker-outside-of-docker):
|
|
# docker compose -p gerbeur-dev logs -f musique
|
|
# docker compose -p gerbeur-dev restart gerbeur
|
|
# docker compose -p gerbeur-dev stop gerbeur musique # then `deno task dev`
|
|
name: gerbeur-dev
|
|
|
|
x-workspace: &workspace
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: gerbeur-dev
|
|
network_mode: host
|
|
user: node
|
|
working_dir: /workspaces/gerbeur
|
|
volumes:
|
|
- ..:/workspaces/gerbeur:cached
|
|
# Shared, so that each service doesn't download the jsr and npm packages
|
|
# again.
|
|
- deno-cache:/home/node/.cache/deno
|
|
|
|
x-instance: &instance
|
|
<<: *workspace
|
|
restart: unless-stopped
|
|
depends_on:
|
|
install:
|
|
condition: service_completed_successfully
|
|
|
|
services:
|
|
dev:
|
|
<<: *workspace
|
|
command: sleep infinity
|
|
|
|
# Installs the packages and draws the icons once, before any instance
|
|
# starts, so that the instances don't do it at the same time.
|
|
install:
|
|
<<: *workspace
|
|
command: sh -c "deno install && deno task icons public"
|
|
|
|
gerbeur:
|
|
<<: *instance
|
|
command: deno run --env-file -A dev/start.ts gerbeur
|
|
|
|
musique:
|
|
<<: *instance
|
|
command: deno run --env-file -A dev/start.ts musique
|
|
|
|
volumes:
|
|
deno-cache:
|