-
Notifications
You must be signed in to change notification settings - Fork 2
/
compose.yaml
40 lines (37 loc) · 1.12 KB
/
compose.yaml
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
version: "3.8"
services:
sindri-js:
container_name: sindri-js
image: sindri-js:latest
build:
args:
GID: "${GID:-1000}"
UID: "${UID:-1000}"
command: ["/bin/sh", "-c", "npm install && npm run build:watch"]
depends_on:
- socat-docker-bridge
environment:
- DOCKER_HOST=tcp://localhost:2375
- SINDRI_DEVELOPMENT_HOST_ROOT=${PWD}
init: true
network_mode: host
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
volumes:
- ./:/sindri/
- ~/.gitconfig:/home/node/.gitconfig
- /tmp/sindri:/tmp/sindri
- /var/run/docker.sock:/var/run/docker.sock
- npm-cache:/home/node/.npm/
# Expose the host's `/var/run/docker.sock` socket as TCP port 2375 using socat as the bridge.
# This allows the `sindri-js` container to access the host's docker daemon without root.
socat-docker-bridge:
image: alpine/socat
command: tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
user: root
volumes:
- /var/run/docker.sock:/var/run/docker.sock
network_mode: host
volumes:
npm-cache: