Skip to content

Commit 9e45816

Browse files
committed
Add dev container files.
1 parent 80ebb55 commit 9e45816

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

.devcontainer/.env

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
POSTGRES_USER=postgres
2+
POSTGRES_PASSWORD=abc123
3+
POSTGRES_DB=postgres
4+
POSTGRES_HOST=postgres
5+
POSTGRES_PORT=5432
6+
7+
ZENSTACK_TEST_DB_USER=postgres
8+
ZENSTACK_TEST_DB_PASS=abc123
9+
ZENSTACK_TEST_DB_NAME=postgres
10+
ZENSTACK_TEST_DB_HOST=postgres
11+
ZENSTACK_TEST_DB_PORT=5432

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "zenstack",
3+
"dockerComposeFile": [
4+
"./docker-compose.yml"
5+
],
6+
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
7+
"workspaceFolder": "/workspace",
8+
"service": "workspace",
9+
"shutdownAction": "stopCompose",
10+
"postCreateCommand": "npm i -g [email protected] && pnpm install && pnpm build && pnpm test-scaffold",
11+
"remoteUser": "node",
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"langium.langium-vscode",
16+
"firsttris.vscode-jest-runner"
17+
]
18+
}
19+
}
20+
}

.devcontainer/docker-compose.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: zenstack
2+
3+
volumes:
4+
postgres-data:
5+
6+
7+
networks:
8+
workspace:
9+
external: false
10+
11+
services:
12+
workspace:
13+
container_name: zenstack-workspace
14+
image: mcr.microsoft.com/devcontainers/javascript-node:20
15+
restart: always
16+
volumes:
17+
- ..:/workspace:cached
18+
env_file: ./.env
19+
command: sleep infinity
20+
networks:
21+
- workspace
22+
23+
postgres:
24+
container_name: zenstack-postgres
25+
image: postgres
26+
restart: always
27+
volumes:
28+
- postgres-data:/var/lib/postgresql/data/
29+
env_file: ./.env
30+
networks:
31+
- workspace
32+
ports:
33+
- 5432:5432
34+
healthcheck:
35+
test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}" ]
36+
interval: 5s
37+
timeout: 5s
38+
retries: 5

0 commit comments

Comments
 (0)