Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
66 lines (61 loc) · 2.39 KB
/
Copy pathcompose.yaml
File metadata and controls
66 lines (61 loc) · 2.39 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Uso:
# docker compose run --rm build -> gera o .deb em ./dist-deb/ (apaga os de builds antigos:
# o volume do target guardava .deb de outras versões)
# docker compose run --rm build-test -> .deb de teste (term7-dev) em ./dist-test/; abra com scripts/run-test.sh
# docker compose run --rm dev -> abre o app na sua tela (hot reload)
x-base: &base
build:
context: .
dockerfile: docker/Dockerfile
args:
UID: ${UID:-1000}
GID: ${GID:-1000}
image: term7-dev
volumes:
- .:/app
# Ficam em volumes do Docker pra não misturar com os do host e pra cache entre execuções.
- node_modules:/app/node_modules
- target:/app/src-tauri/target
- cargo-registry:/home/dev/.cargo/registry
services:
build:
<<: *base
command: >
bash -c "rm -f src-tauri/target/release/bundle/deb/*.deb dist-deb/*.deb
&& npm ci && npx tauri build --bundles deb
&& mkdir -p dist-deb && cp src-tauri/target/release/bundle/deb/*.deb dist-deb/"
# Build de teste: outro nome e identificador (configurações, sessão e janela à parte),
# pra rodar ao lado da release instalada. Abra com scripts/run-test.sh.
build-test:
<<: *base
command: >
bash -c "rm -f src-tauri/target/release/bundle/deb/*.deb dist-test/*.deb
&& npm ci && npx tauri build --bundles deb --config src-tauri/tauri.test.conf.json
&& mkdir -p dist-test && cp src-tauri/target/release/bundle/deb/*.deb dist-test/"
dev:
<<: *base
volumes:
- .:/app
- node_modules:/app/node_modules
- target:/app/src-tauri/target
- cargo-registry:/home/dev/.cargo/registry
# Janela: usa o socket Wayland do host (com X11 de reserva).
- ${XDG_RUNTIME_DIR:-/run/user/1000}/${WAYLAND_DISPLAY:-wayland-0}:/tmp/runtime/${WAYLAND_DISPLAY:-wayland-0}
- /tmp/.X11-unix:/tmp/.X11-unix:ro
environment:
XDG_RUNTIME_DIR: /tmp/runtime
WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-wayland-0}
DISPLAY: ${DISPLAY:-:0}
# Evita janela em branco do WebKitGTK dentro de container.
WEBKIT_DISABLE_DMABUF_RENDERER: "1"
devices:
- /dev/dri:/dev/dri
# GIDs dos grupos video/render do host (veja com: stat -c %g /dev/dri/renderD128).
group_add:
- "${VIDEO_GID:-44}"
- "${RENDER_GID:-110}"
command: bash -c "npm ci && npm run tauri dev"
volumes:
node_modules:
target:
cargo-registry: