Skip to content

Commit be00cf7

Browse files
committed
feature. Added postCreate shell script and used in the devcontainer to add extra configuration to solve the freezing issue.
1 parent 08c10ab commit be00cf7

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

.devcontainer/devcontainer.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@
88
"--userns=keep-id"
99
],
1010
"containerEnv": {
11-
"HOME": "/home/node",
12-
"DOCKER_HOST": "unix:///var/run/podman/podman.sock'"
11+
"HOME": "/home/node"
1312
},
1413
"features": {
1514
"ghcr.io/devcontainers/features/git-lfs:1": {},
16-
"ghcr.io/devcontainers/features/github-cli:1": {},
17-
"ghcr.io/devcontainers-contrib/features/act-asdf:2": {}
15+
"ghcr.io/devcontainers/features/github-cli:1": {}
1816
},
1917
"customizations": {
2018
"vscode": {
@@ -26,7 +24,7 @@
2624
}
2725
},
2826
"forwardPorts": [],
29-
"postCreateCommand": "npm install -g npm && npm install && git lfs pull"
27+
"postCreateCommand": "./.devcontainer/scripts/postCreate.sh"
3028

3129
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
3230
// "remoteUser": "root"

.devcontainer/scripts/postCreate.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Exit immediately if a command exits with a non-zero status
4+
set -e
5+
6+
# Update NPM
7+
echo "Updating npm..."
8+
npm install -g npm@latest
9+
10+
# Install project dependencies
11+
echo "Installing npm dependencies..."
12+
npm install
13+
14+
# Install Playwright Dependencies
15+
echo "Installing Playwright dependencies..."
16+
npx playwright install --with-deps
17+
18+
# Setup and checkout files with Git LFS
19+
echo "Checking out LFS files..."
20+
git lfs install
21+
git lfs pull
22+
git lfs checkout
23+
24+
# Build the project
25+
echo "Building the project..."
26+
npm run build
27+
28+
# Print completion message
29+
echo "Post-create commands executed successfully!"

package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)