Skip to content

Commit 576c611

Browse files
committed
Introduce .devcontainer for dockerize development using VSCode
1 parent e1b8563 commit 576c611

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose
3+
{
4+
"name": "Existing Docker Compose (Extend)",
5+
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+
13+
// The 'service' property is the name of the service for the container that VS Code should
14+
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
15+
"service": "base",
16+
17+
// The optional 'workspaceFolder' property is the path VS Code should open by default when
18+
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
19+
"workspaceFolder": "/usr/src/service",
20+
21+
// Features to add to the dev container. More info: https://containers.dev/features.
22+
// "features": {},
23+
24+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
25+
"forwardPorts": [8088],
26+
27+
// Uncomment the next line if you want start specific services in your Docker Compose config.
28+
// "runServices": []
29+
30+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
31+
// "shutdownAction": "none",
32+
33+
// Uncomment the next line to run commands after the container is created.
34+
"postCreateCommand": "npm install --no-save --unsafe-perm"
35+
36+
// Configure tool-specific properties.
37+
// "customizations": {},
38+
39+
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
40+
// "remoteUser": "devcontainer"
41+
}

.devcontainer/docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: '3'
2+
services:
3+
# Update this to the name of the service you want to work with in your docker-compose.yml file
4+
base:
5+
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
6+
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
7+
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
8+
# array). The sample below assumes your primary file is in the root of your project.
9+
#
10+
# build:
11+
# context: .
12+
# dockerfile: .devcontainer/Dockerfile
13+
14+
# volumes:
15+
# # Update this to wherever you want VS Code to mount the folder of your project
16+
# - ..:/usr/src/service
17+
18+
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
19+
# cap_add:
20+
# - SYS_PTRACE
21+
# security_opt:
22+
# - seccomp:unconfined
23+
24+
# Overrides default command so things don't shut down after the process ends.
25+
command: /bin/sh -c "while sleep 1000; do :; done"
26+

.docker_env

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NODE_ENV=development
2+
CADENCE_TCHANNEL_PEERS="localhost:16232"
3+
CADENCE_TCHANNEL_SERVICE=cadence-frontend
4+
CADENCE_WEB_PORT=8088
5+
CADENCE_EXTERNAL_SCRIPTS=""
6+
ENABLE_AUTH=false
7+
AUTH_TYPE=""
8+
AUTH_ADMIN_JWT_PRIVATE_KEY=""

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3'
2+
services:
3+
base:
4+
env_file:
5+
- .docker_env
6+
image: node:fermium-bullseye
7+
volumes:
8+
- .:/usr/src/service
9+
working_dir: /usr/src/service
10+
command: npm run dev
11+
install:
12+
extends:
13+
base
14+
command: /bin/sh -c "npm install --no-save --unsafe-perm"

0 commit comments

Comments
 (0)