-
Notifications
You must be signed in to change notification settings - Fork 420
Expand file tree
/
Copy pathdevcontainer.json
More file actions
65 lines (59 loc) · 1.82 KB
/
devcontainer.json
File metadata and controls
65 lines (59 loc) · 1.82 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
"name": "React Native (macOS)",
// Use a pre-built image with Node.js and common tools
"image": "mcr.microsoft.com/devcontainers/javascript-node:18",
// Or build from a Dockerfile for more control (uncomment the lines below)
// "build": {
// "dockerfile": "Dockerfile"
// },
// Add additional features (CLI tools)
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installMaven": false,
"installGradle": true
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/ruby:1": {
"version": "3.2"
}
},
// Configure environment variables (optional)
"containerEnv": {
"ANDROID_HOME": "/usr/local/android-sdk",
"JAVA_HOME": "/usr/local/sdkman/candidates/java/current"
},
// Run commands after the container is created
"postCreateCommand": "bash .devcontainer/post-create.sh",
// Ports to forward (Metro bundler uses 8081)
"forwardPorts": [8081, 19000, 19001, 19002, 8081],
"portsAttributes": {
"8081": {
"label": "Metro Bundler",
"onAutoForward": "notify"
}
},
// Install VS Code extensions for React Native
"customizations": {
"vscode": {
"extensions": [
"msjsdiag.vscode-react-native",
"msjsdiag.vscode-react-native-tools",
"dsznajder.es7-react-js-snippets",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"vscjava.vscode-java-pack",
"redhat.vscode-xml",
"vadimcn.vscode-lldb"
],
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"react-native-tools.showDevMenuOnStartup": true
}
}
},
// Use a non-root user to avoid permission issues
"remoteUser": "node"
}