feat(docker): add development compose setup

This commit is contained in:
Federico Jaramillo Martinez
2026-06-20 22:18:15 +02:00
parent 1fa1726083
commit fb36f48fea
4 changed files with 161 additions and 0 deletions
+95
View File
@@ -0,0 +1,95 @@
name: pi-web-dev
x-pi-web-dev-build: &pi-web-dev-build
context: ..
dockerfile: docker/Dockerfile.dev
x-pi-web-dev-environment: &pi-web-dev-environment
HOME: /data/home
XDG_CONFIG_HOME: /data/config
PI_WEB_DATA_DIR: /data/pi-web
PI_WEB_SESSIOND_SOCKET: /data/pi-web/sessiond.sock
PI_CODING_AGENT_DIR: /data/pi-agent
HOSTEXEC_IMAGE: ${HOSTEXEC_IMAGE:-alpine:3.22}
PI_WEB_MAX_UPLOAD_BYTES: ${PI_WEB_MAX_UPLOAD_BYTES:-67108864}
NPM_CONFIG_UPDATE_NOTIFIER: "false"
NPM_CONFIG_CACHE: /data/npm-cache
x-pi-web-dev-volumes: &pi-web-dev-volumes
- type: bind
source: ..
target: /workspace
- type: volume
source: node_modules
target: /workspace/node_modules
- type: volume
source: data
target: /data
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
- type: bind
source: /srv
target: /srv
- type: bind
source: /opt
target: /opt
- type: bind
source: /home
target: /home
- type: bind
source: /
target: /host
read_only: true
services:
sessiond:
build: *pi-web-dev-build
image: ${PI_WEB_DEV_IMAGE:-pi-web:dev}
command: ["npm", "run", "start:sessiond"]
working_dir: /workspace
user: "${PI_WEB_UID:-1000}:${PI_WEB_GID:-1000}"
group_add:
- "${DOCKER_GID:-0}"
security_opt:
- label=disable
environment: *pi-web-dev-environment
volumes: *pi-web-dev-volumes
healthcheck:
test: ["CMD-SHELL", "test -S /data/pi-web/sessiond.sock"]
interval: 5s
timeout: 3s
retries: 24
start_period: 5s
web:
build: *pi-web-dev-build
image: ${PI_WEB_DEV_IMAGE:-pi-web:dev}
command: ["bash", "-lc", "trap 'kill 0' EXIT; npm run dev:web & npm run dev:client & wait"]
working_dir: /workspace
depends_on:
sessiond:
condition: service_healthy
user: "${PI_WEB_UID:-1000}:${PI_WEB_GID:-1000}"
group_add:
- "${DOCKER_GID:-0}"
security_opt:
- label=disable
environment:
<<: *pi-web-dev-environment
PI_WEB_HOST: 0.0.0.0
PI_WEB_PORT: "8504"
ports:
- "${PI_WEB_DEV_API_BIND_ADDR:-127.0.0.1}:${PI_WEB_DEV_API_PORT:-8504}:8504"
- "${PI_WEB_DEV_BIND_ADDR:-127.0.0.1}:${PI_WEB_DEV_PORT:-8505}:8505"
volumes: *pi-web-dev-volumes
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:8504/api/pi-web/runtime >/dev/null"]
interval: 10s
timeout: 5s
retries: 12
start_period: 10s
volumes:
data:
node_modules: