Skip to content

Commit 0df4f56

Browse files
authored
Merge pull request #11 from Kwstubbs/devcontainer-configuration
Add devcontainer files
2 parents 2c8d07b + 845d6b9 commit 0df4f56

File tree

3 files changed

+118
-0
lines changed

3 files changed

+118
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Use Ubuntu 24.04 as base image to match the current environment
2+
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
3+
4+
# Install system dependencies
5+
# Note: Python and Git are installed via devcontainer features
6+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
7+
&& apt-get -y install --no-install-recommends \
8+
build-essential \
9+
&& apt-get clean \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
# Set working directory
13+
WORKDIR /workspaces/seclab-taskflow-agent
14+
15+
# The rest of the setup will be done in post-create script

.devcontainer/devcontainer.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "Seclab Taskflow Agent",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
},
7+
// Features to add to the dev container
8+
"features": {
9+
"ghcr.io/devcontainers/features/python:1": {
10+
"version": "3.11",
11+
"installTools": true
12+
},
13+
"ghcr.io/devcontainers/features/git:1": {
14+
"version": "latest"
15+
},
16+
"ghcr.io/devcontainers/features/github-cli:1": {
17+
"version": "latest"
18+
}
19+
},
20+
// Configure tool-specific properties
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"ms-python.python",
25+
"ms-python.vscode-pylance",
26+
"redhat.vscode-yaml",
27+
"GitHub.copilot",
28+
"GitHub.copilot-chat",
29+
"ms-azuretools.vscode-docker"
30+
],
31+
"settings": {
32+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
33+
"python.terminal.activateEnvironment": true
34+
}
35+
}
36+
},
37+
// Use 'forwardPorts' to make a list of ports inside the container available locally
38+
"forwardPorts": [],
39+
// Use 'postCreateCommand' to run commands after the container is created
40+
"postCreateCommand": "bash .devcontainer/post-create.sh",
41+
// Use 'postStartCommand' to run commands when the container starts
42+
// "postStartCommand": "",
43+
// Environment variables
44+
"containerEnv": {
45+
"PYTHONUNBUFFERED": "1"
46+
},
47+
// Set the user to use in the container (non-root)
48+
"remoteUser": "vscode",
49+
// Grant the container access to the host's Docker daemon
50+
"runArgs": [
51+
"--privileged",
52+
"--init"
53+
]
54+
}

.devcontainer/post-create.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "🚀 Setting up Seclab Taskflow Agent development environment..."
5+
6+
# Create Python virtual environment
7+
echo "📦 Creating Python virtual environment..."
8+
python3 -m venv .venv
9+
10+
# Activate virtual environment and install dependencies
11+
echo "📥 Installing Python dependencies..."
12+
source .venv/bin/activate
13+
python -m pip install --upgrade pip
14+
python -m pip install -r requirements.txt
15+
16+
# If running in Codespaces, check for necessary secrets and print error if missing
17+
if [ -n "$CODESPACES" ]; then
18+
echo "🔐 Running in Codespaces - injecting secrets from Codespaces settings..."
19+
if [ -n "$COPILOT_TOKEN" ]; then
20+
echo "Running in Codespaces - please add COPILOT_TOKEN to your Codespaces secrets"
21+
fi
22+
if [ -n "$GITHUB_AUTH_HEADER" ]; then
23+
echo "Running in Codespaces - please add GITHUB_AUTH_HEADER to your Codespaces secrets"
24+
fi
25+
fi
26+
27+
# Create .env file if it doesn't exist
28+
if [ ! -f .env ]; then
29+
echo "📝 Creating .env template..."
30+
cat > .env << 'EOF'
31+
32+
# Optional: CodeQL database base path
33+
CODEQL_DBS_BASE_PATH=/workspaces/seclab-taskflow-agent/my_data
34+
35+
EOF
36+
echo "⚠️ Please configure the enviroment or your .env file with required tokens!"
37+
fi
38+
39+
# Create logs directory if it doesn't exist
40+
mkdir -p logs
41+
42+
# Create optional data directories
43+
mkdir -p my_data
44+
45+
echo "✅ Development environment setup complete!"
46+
echo ""
47+
echo "📋 Next steps:"
48+
echo "Configure your environment with COPILOT_TOKEN and GITHUB_AUTH_HEADER as needed."
49+
echo "💡 Remember to activate the virtual environment: source .venv/bin/activate"

0 commit comments

Comments
 (0)