Skip to content

Commit 87ec92c

Browse files
bootstrap
1 parent ce16a40 commit 87ec92c

File tree

2 files changed

+21
-40
lines changed

2 files changed

+21
-40
lines changed

.devcontainer/devcontainer.json

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
{
22
"name": "APIM Samples",
33
"build": {
4-
"dockerfile": "Dockerfile",
4+
"dockerfile": "Dockerfile.minimal",
55
"context": ".."
66
},
77
"features": {
8-
"ghcr.io/devcontainers/features/azure-cli:1": {
9-
"version": "2.72.0"
10-
},
11-
"ghcr.io/devcontainers/features/common-utils:2": {
12-
"installZsh": true,
13-
"configureZshAsDefaultShell": true,
14-
"installOhMyZsh": true,
15-
"upgradePackages": true,
16-
"username": "vscode",
17-
"uid": "1000",
18-
"gid": "1000"
19-
},
20-
"ghcr.io/devcontainers/features/git:1": {
21-
"version": "latest",
22-
"ppa": true
23-
}
8+
// Temporarily disabled all features to troubleshoot sleep command issue
9+
// "ghcr.io/devcontainers/features/azure-cli:1": {
10+
// "version": "2.72.0"
11+
// },
12+
// "ghcr.io/devcontainers/features/common-utils:2": {
13+
// "installZsh": true,
14+
// "configureZshAsDefaultShell": true,
15+
// "installOhMyZsh": true,
16+
// "upgradePackages": true,
17+
// "username": "vscode",
18+
// "uid": "1000",
19+
// "gid": "1000"
20+
// },
21+
// "ghcr.io/devcontainers/features/git:1": {
22+
// "version": "latest",
23+
// "ppa": true
24+
// }
2425
// Temporarily disabled docker-in-docker to troubleshoot container startup issues
2526
// "ghcr.io/devcontainers/features/docker-in-docker:2": {
2627
// "version": "latest",
@@ -114,22 +115,9 @@
114115
"PYTHONPATH": "/workspaces/Apim-Samples/shared/python:/workspaces/Apim-Samples",
115116
"PATH": "/workspaces/Apim-Samples/.venv/bin:/home/vscode/.local/bin:${PATH}"
116117
},
117-
// Container lifecycle commands for optimal Codespaces prebuild performance: https://containers.dev/implementors/features/#lifecycle-hooks
118-
// 1. onCreateCommand: Runs only once during initial prebuild - creates venv
119-
// 2. updateContentCommand: Runs during any prebuild when content changes - installs/updates packages
120-
// 3. postStartCommand: Runs on every startup - verifies and configures
121-
"onCreateCommand": [
122-
"bash", "-c",
123-
"echo '🚀 Creating Python virtual environment in workspace...' && /usr/local/bin/python3.12 -m venv /workspaces/Apim-Samples/.venv --copies && source /workspaces/Apim-Samples/.venv/bin/activate && pip install --upgrade pip setuptools wheel && echo '✅ Virtual environment created'"
124-
],
125-
"updateContentCommand": [
126-
"bash", "-c",
127-
"echo '📦 Installing/updating Python packages from requirements.txt...' && source /workspaces/Apim-Samples/.venv/bin/activate && pip install -r requirements.txt && pip install pytest pytest-cov coverage ipykernel && echo '✅ Python packages installed/updated' && python setup/setup_python_path.py --generate-env && echo '✅ Environment configuration updated' && echo '🔧 Registering Jupyter kernel...' && python -m ipykernel install --user --name=apim-samples --display-name='APIM Samples Python 3.12' --python=$(which python) && jupyter kernelspec list | grep apim-samples && echo '✅ Jupyter kernel registered successfully' && echo '⚙️ Configuring Azure CLI...' && az config set core.login_experience_v2=off 2>/dev/null || true && az extension add --name containerapp --only-show-errors 2>/dev/null || true && az extension add --name front-door --only-show-errors 2>/dev/null || true && echo '✅ Azure CLI configured for Codespaces'"
128-
],
129-
"postStartCommand": [
130-
"bash", "-c",
131-
"echo 'APIM Samples Codespace Starting - Keep this terminal open to see progress!' && bash .devcontainer/post-start-setup.sh"
132-
],
118+
// Simplified lifecycle commands - no sleep dependencies
119+
"onCreateCommand": "echo 'Container created successfully'",
120+
"postStartCommand": "echo 'Container started - running basic setup...' && bash .devcontainer/post-start-setup.sh",
133121
"forwardPorts": [
134122
8000,
135123
8080,

.devcontainer/post-start-setup.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,6 @@ echo "==========================================================================
100100
echo "Core Utilities Status:"
101101

102102
# Test essential commands that should always be available
103-
if command -v sleep >/dev/null 2>&1; then
104-
echo " ✅ sleep command"
105-
else
106-
echo " ❌ sleep command missing - installing..."
107-
sudo apt-get update >/dev/null 2>&1 && sudo apt-get install -y coreutils >/dev/null 2>&1
108-
fi
109-
110103
if command -v cat >/dev/null 2>&1; then
111104
echo " ✅ cat command"
112105
else

0 commit comments

Comments
 (0)