-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
32 lines (30 loc) · 1.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
32 lines (30 loc) · 1.06 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
version: "3.9"
services:
# vscode will connect to this service as the dev container
example-devcontainer:
build:
context: .
dockerfile: Dockerfile
volumes:
- ${WORKSPACE_SOURCE:?}:${WORKSPACE_TARGET:?}
command: sleep infinity
depends_on:
- example-service
env_file:
# If you need to access the WORKSPACE_* envars in the container
- .env
# Another container with access to the workspace files.
# It serves the workspace files - http://example-service:8000
example-service:
image: python
working_dir: ${WORKSPACE_ROOT:?}
command: python -m http.server
volumes:
- ${WORKSPACE_SOURCE:?}:${WORKSPACE_TARGET:?}
volumes:
# $WORKSPACE_SOURCE is "devcontainer-volume" when the workspace is in a
# volume, and devcontainer-volume is an alias for the actual external volume.
# In bind-mount workspaces, it's an empty, unused volume created by compose.
devcontainer-volume:
name: ${WORKSPACE_CONTAINER_VOLUME_SOURCE:-not-used-in-bind-mount-workspace}
external: ${WORKSPACE_IS_CONTAINER_VOLUME:?}