-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-compose.base.yml
More file actions
93 lines (89 loc) · 3.85 KB
/
Copy pathdocker-compose.base.yml
File metadata and controls
93 lines (89 loc) · 3.85 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
services:
# This service is responsible for providing the main development environment for developers
devcontainer:
hostname: ${COMPOSE_PROJECT_NAME:-react-ui}_devcontainer
build:
context: docker/react_ui_devcontainer/
dockerfile: Dockerfile
# Start dependent services before starting the `devcontainer` service to ensure that the necessary environments
# and tools are available when the `devcontainer` starts.
depends_on:
node:
condition: service_started
playwright:
condition: service_started
docs:
condition: service_started
# Run as host UID/GID so files created in mounted volumes are owned correctly on the host.
# The images use `fixuid` (https://github.com/boxboat/fixuid) to remap the built-in `developer`
# user to these IDs at startup — the `user:` directive is required for that remap to work.
# Applied to all services below for the same reason.
user: ${COMPOSE_UID}:${COMPOSE_GID}
# Keep the container running indefinitely to allow developers to attach to it and use it as their development environment
command: sleep infinity
# Injects environment variables from the `.env` file into the `devcontainer` service,
# making them accessible within the container's environment.
env_file:
- .env
environment:
# This must be set correctly for the `devcontainer` to be able to access the host's Docker daemon,
# enabling Docker-from-Docker capabilities (e.g., running Docker commands from within the `devcontainer`).
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-react-ui}
init: true
volumes:
- .:/workspace:z
# The following volume is used to allow the `devcontainer` to access the host's Docker daemon,
# enabling Docker-from-Docker capabilities (e.g., running Docker commands from within the `devcontainer`).
- /var/run/docker.sock:/var/run/docker.sock
# The following named volumes persist data (e.g. terminal history, AI tools data, etc.) across container restarts.
# Using separate named volumes (instead of a single volume with subpaths) allows Docker to automatically
# seed the volume with data from the image on first use.
- terminal-history:/home/developer/.terminal_history
- claude-config:/home/developer/.config/claude
- claude-state:/home/developer/.local/state/claude
- copilot:/home/developer/.copilot
- copilot-config:/home/developer/.config/copilot
- opencode-config:/home/developer/.config/opencode
- opencode-share:/home/developer/.local/share/opencode
- opencode-state:/home/developer/.local/state/opencode
# This service provides Node environment and NPM
node:
build: docker/node
user: ${COMPOSE_UID}:${COMPOSE_GID}
entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-node.sh; else sleep infinity; fi'
env_file:
- .env
volumes:
- .:/workspace:z
# This service provides Playwright environment and tools for browser automation and testing
playwright:
build: docker/playwright
user: ${COMPOSE_UID}:${COMPOSE_GID}
command: sleep infinity
env_file:
- .env
ports:
- ${COMPOSE_PLAYWRIGHT_REPORT_PORT}:9323
volumes:
- .:/workspace:z
# This provides server for documentation
docs:
build: docker/mkdocs
user: ${COMPOSE_UID}:${COMPOSE_GID}
entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-mkdocs.sh; else sleep infinity; fi'
env_file:
- .env
ports:
- ${COMPOSE_DOCS_SERVER_PORT}:8000
volumes:
- .:/workspace:z
volumes:
# The following volumes are used to persist data (e.g. terminal history, AI tools data, etc.) across container restarts
terminal-history:
claude-config:
claude-state:
copilot:
copilot-config:
opencode-config:
opencode-share:
opencode-state: