Skip to content

Commit f58282f

Browse files
authored
feat: Add a devcontainer (#11596)
1 parent 246c3c2 commit f58282f

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "Open Collective API",
3+
"dockerComposeFile": [
4+
"../docker-compose/node.yml", // Shell for VSCode terminal
5+
"../docker-compose/db.yml",
6+
"../docker-compose/mail.yml",
7+
"../docker-compose/uploads.yml"
8+
],
9+
"service": "dev",
10+
"containerEnv": {
11+
"PG_HOST": "postgres",
12+
"MAILPIT_HOST": "mailpit",
13+
"AWS_S3_ENDPOINT": "http://minio:9000"
14+
},
15+
// Features to add to the dev container. More info: https://containers.dev/features.
16+
"features": {
17+
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {
18+
"version": "16"
19+
}
20+
},
21+
// Extensions
22+
"customizations": {
23+
"vscode": {
24+
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "thebearingedge.vscode-sql-lit"]
25+
}
26+
},
27+
"portsAttributes": {
28+
"3060": {
29+
"label": "API",
30+
"onAutoForward": "notify",
31+
"requireLocalPort": true
32+
},
33+
"5432": {
34+
"label": "Postgres",
35+
"onAutoForward": "silent",
36+
"requireLocalPort": true
37+
},
38+
"1080": {
39+
"label": "Mailpit",
40+
"onAutoForward": "silent",
41+
"requireLocalPort": true
42+
},
43+
"9000": {
44+
"label": "MinIO",
45+
"onAutoForward": "silent",
46+
"requireLocalPort": true
47+
},
48+
"9001": {
49+
"label": "MinIO Console",
50+
"onAutoForward": "silent",
51+
"requireLocalPort": true
52+
}
53+
},
54+
"postCreateCommand": "npm install",
55+
"postStartCommand": "npm run dev",
56+
"remoteUser": "node"
57+
}

docker-compose/node.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# A developer environment for TypeScript/Node.js,
2+
services:
3+
dev:
4+
image: mcr.microsoft.com/devcontainers/typescript-node:24
5+
# Mount the API repo root (parent of this folder), not docker-compose/
6+
volumes:
7+
- ..:/workspace
8+
working_dir: /workspace
9+
command: sleep infinity
10+
networks:
11+
- default

0 commit comments

Comments
 (0)