Skip to content

Commit c4aefec

Browse files
authored
VS Code Devcontainers (#956)
1 parent 6afd22c commit c4aefec

File tree

4 files changed

+94
-5
lines changed

4 files changed

+94
-5
lines changed

.devcontainer/devcontainer.json

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/docker-existing-docker-compose
3+
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
4+
{
5+
"name": "Existing Docker Compose (Extend)",
6+
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
7+
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
8+
"dockerComposeFile": [
9+
"../docker-compose.yml",
10+
"docker-compose.yml"
11+
],
12+
// The 'service' property is the name of the service for the container that VS Code should
13+
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
14+
"service": "app",
15+
"runServices": [
16+
"db",
17+
"app",
18+
],
19+
// The optional 'workspaceFolder' property is the path VS Code should open by default when
20+
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
21+
"workspaceFolder": "/workspace",
22+
// Set *default* container specific settings.json values on container create.
23+
"settings": {
24+
"terminal.integrated.defaultProfile.linux": "bash",
25+
"python.defaultInterpreterPath": "/usr/bin/python3",
26+
"python.pythonPath": "/usr/bin/python3",
27+
"files.eol": "\n",
28+
"editor.formatOnSave": true,
29+
},
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"ms-python.python",
33+
"ms-python.vscode-pylance",
34+
"visualstudioexptteam.vscodeintellicode",
35+
"littlefoxteam.vscode-python-test-adapter",
36+
"kevinrose.vsc-python-indent",
37+
"shardulm94.trailing-spaces",
38+
"redhat.vscode-yaml",
39+
"oderwat.indent-rainbow",
40+
"medo64.render-crlf",
41+
"ms-azuretools.vscode-docker",
42+
"ms-vscode-remote.vscode-remote-extensionpack",
43+
],
44+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
45+
// "forwardPorts": [],
46+
// Uncomment the next line if you want start specific services in your Docker Compose config.
47+
// "runServices": [],
48+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
49+
// "shutdownAction": "none",
50+
// Uncomment the next line to run commands after the container is created - for example installing curl.
51+
//"postCreateCommand": "",
52+
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
53+
// "remoteUser": "vscode"
54+
}

.devcontainer/docker-compose.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: "3.3"
2+
services:
3+
# Update this to the name of the service you want to work with in your docker-compose.yml file
4+
app:
5+
# If you want add a non-root user to your Dockerfile, you can use the "remoteUser"
6+
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks,
7+
# debugging) to execute as the user. Uncomment the next line if you want the entire
8+
# container to run as this user instead. Note that, on Linux, you may need to
9+
# ensure the UID and GID of the container user you create matches your local user.
10+
# See https://aka.ms/vscode-remote/containers/non-root for details.
11+
#
12+
# user: vscode
13+
14+
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
15+
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
16+
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
17+
# array). The sample below assumes your primary file is in the root of your project.
18+
#
19+
# build:
20+
# context: .
21+
# dockerfile: .devcontainer/Dockerfile
22+
23+
volumes:
24+
# Update this to wherever you want VS Code to mount the folder of your project
25+
- .:/workspace:cached
26+
27+
# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
28+
# - /var/run/docker.sock:/var/run/docker.sock
29+
30+
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
31+
# cap_add:
32+
# - SYS_PTRACE
33+
# security_opt:
34+
# - seccomp:unconfined
35+
36+
# Overrides default command so things don't shut down after the process ends.
37+
command: /bin/sh -c "while sleep 1000; do :; done"

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ EXPOSE 8080
2626
RUN ./deploy/prebuild_wo_frontend.sh
2727

2828
ENTRYPOINT ["./deploy/docker-entrypoint.sh"]
29-
CMD ["label-studio"]
29+
CMD ["label-studio"]

docker-compose.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
version: '3.3'
1+
version: "3.3"
22

33
services:
4-
54
nginx:
65
image: nginx:latest
76
ports:
@@ -55,6 +54,5 @@ services:
5554
volumes:
5655
- ${POSTGRES_DATA_DIR:-./postgres-data}:/var/lib/postgresql/data
5756

58-
5957
volumes:
60-
static: {}
58+
static: {}

0 commit comments

Comments
 (0)