-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (69 loc) · 2.21 KB
/
docker-compose.yml
File metadata and controls
77 lines (69 loc) · 2.21 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
67
68
69
70
71
72
73
74
75
76
services:
devbox:
image: predkambrij/devbox_${COMPOSE_PROJECT_NAME}:latest
build:
context: .
network: host
dockerfile_inline: |
FROM ubuntu:25.10
ENV DEBIAN_FRONTEND noninteractive
ARG ARG_UID
ARG ARG_GID
ARG ARG_UNAME
ARG ARG_GNAME
COPY .assets/build_as_root.sh /
RUN /build_as_root.sh prepareUser
USER ${ARG_UNAME}
COPY .assets/build_as_user.sh /
RUN /build_as_user.sh aptUpdate && \
/build_as_user.sh installSomeSw && \
/build_as_user.sh installMoreSw
USER root
COPY .assets/supervisord.conf /etc/
ENTRYPOINT ["/bin/bash", "-c", "env | grep -vE 'PATH|HOSTNAME|PWD|HOME|SHLVL|^_=' >> /etc/environment; mkdir -p /run/user/${ARG_UID} && chmod 700 /run/user/${ARG_UID} && chown ${ARG_UID}:${ARG_GID} /run/user/${ARG_UID}; exec /usr/bin/supervisord -n -c /etc/supervisord.conf"]
args:
ARG_UID: ${ARG_UID}
ARG_GID: ${ARG_GID}
ARG_UNAME: ${ARG_UNAME}
ARG_GNAME: ${ARG_GNAME}
networks:
- network
# ports:
# - "2022:22"
# network_mode: host
extra_hosts:
- "${DEVBOX_HOSTNAME}:127.0.0.1"
- "${DEVBOX_HOSTNAME}.localdomain:127.0.0.1"
hostname: "${DEVBOX_HOSTNAME}.localdomain"
environment:
- DISPLAY
- PULSE_SERVER=unix:${XDG_RUNTIME_DIR}/pulse/native
env_file: .env
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/.X11-unix:/tmp/.X11-unix
- /dev/shm:/dev/shm
- /run/dbus/:/run/dbus/
- ~/.Xauthority:/home/${ARG_UNAME}/.Xauthority
- ${DEVBOX_ROOT}:/build/
- homeuser:/home/${ARG_UNAME}
- ${XDG_RUNTIME_DIR}/pulse:${XDG_RUNTIME_DIR}/pulse
- /run/user/${ARG_UID}:/run/user/${ARG_UID}
logging:
driver: json-file
options:
max-size: "100m"
#privileged: true
#deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all # 1 # alternatively, use `count: all` for all GPUs
# capabilities: [gpu, graphics, video, compute, utility, display]
volumes:
homeuser:
networks:
network:
name: "${NETWORK_NAME}"
external: true