Skip to content

Commit 0673f38

Browse files
committed
Yolo
1 parent a3c7892 commit 0673f38

3 files changed

Lines changed: 82 additions & 7 deletions

File tree

{{cookiecutter.project_name|replace(" ", "")}}/.devcontainer/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@ This project includes Dev Container support for VS Code and other compatible edi
1717
2. In VS Code, use Command Palette: `Dev Containers: Attach to Running Container`
1818
3. Select the `{{ cookiecutter.project_slug }}-dev` container
1919

20-
### Option 3: Manual Docker Commands
20+
### Option 3: Command Line Access
2121
```bash
2222
# Build and start the dev container
2323
task dev-container
2424

25+
# Check if container is running
26+
task dev-container-status
27+
2528
# Access the container shell
26-
docker exec -it {{ cookiecutter.project_slug }}-dev bash
29+
task dev-container-shell
30+
31+
# Run a specific command
32+
task dev-container-exec CMD="python --version"
2733

2834
# Stop the container when done
2935
task dev-container-stop
@@ -41,7 +47,7 @@ The dev container includes:
4147
## Environment
4248

4349
- `DEV_MODE=true` - Installs all development dependencies
44-
- `PYTHONPATH=/workspace/src` - Ensures proper module imports
50+
- Python path set to `/workspace/src` - Ensures proper module imports
4551
- Working directory: `/workspace`
4652

4753
## Troubleshooting

{{cookiecutter.project_name|replace(" ", "")}}/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,50 @@ This project is configured with automated dependency management:
5050

5151
Both tools are pre-configured and will start working once the repository is pushed to GitHub.
5252

53+
## Development Containers
54+
55+
This project includes Dev Container support for consistent development environments.
56+
57+
### Quick Start with VS Code
58+
59+
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
60+
2. Open this project in VS Code
61+
3. Click "Reopen in Container" when prompted, or use the command palette: `Dev Containers: Reopen in Container`
62+
63+
### Alternative: Attach to Running Container
64+
65+
If you prefer to manage the container manually:
66+
67+
```bash
68+
# Build and start the development container
69+
task dev-container
70+
71+
# Check container status
72+
task dev-container-status
73+
74+
# Access the container shell
75+
task dev-container-shell
76+
77+
# Run a specific command in the container
78+
task dev-container-exec CMD="python --version"
79+
80+
# Stop the container when done
81+
task dev-container-stop
82+
```
83+
84+
To attach from VS Code: Use command palette `Dev Containers: Attach to Running Container` and select `{{ cookiecutter.project_slug }}-dev`.
85+
86+
### What's Included
87+
88+
The development container provides:
89+
- Python {{ cookiecutter.python_version }}+ with all project dependencies
90+
- Development tools: uv, Task, pre-commit, git
91+
- VS Code extensions for Python development
92+
- Live code editing with proper volume mounts
93+
- All dependencies installed (including dev dependencies)
94+
95+
For more details, see [.devcontainer/README.md](.devcontainer/README.md).
96+
5397
## FAQs
5498

5599
For frequently asked questions including release workflow troubleshooting, see our [FAQ documentation](./FAQ.md).

{{cookiecutter.project_name|replace(" ", "")}}/Taskfile.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ tasks:
226226
- |
227227
echo "✅ Development container '{{ '{{.PROJECT_SLUG}}' }}-dev' is running!"
228228
echo ""
229-
echo "To attach to it:"
229+
echo "To use it:"
230230
echo " • VS Code: Use 'Dev Containers: Attach to Running Container' command"
231-
echo " • Terminal: docker exec -it {{ '{{.PROJECT_SLUG}}' }}-dev bash"
232-
echo ""
233-
echo "To stop it: task dev-container-stop"
231+
echo " • Terminal: task dev-container-shell"
232+
echo " • Check status: task dev-container-status"
233+
echo " • Stop: task dev-container-stop"
234234
235235
dev-container-stop:
236236
desc: Stop and remove development container
@@ -239,6 +239,31 @@ tasks:
239239
- docker rm {{ '{{.PROJECT_SLUG}}' }}-dev 2>/dev/null || true
240240
- echo "Development container stopped and removed."
241241

242+
dev-container-exec:
243+
desc: Execute a command in the development container (default: bash)
244+
vars:
245+
CMD: '{{ '{{.CMD | default "bash"}}' }}'
246+
cmds:
247+
- docker exec -it {{ '{{.PROJECT_SLUG}}' }}-dev {{ '{{.CMD}}' }}
248+
249+
dev-container-shell:
250+
desc: Open a shell in the development container
251+
cmds:
252+
- task: dev-container-exec
253+
vars:
254+
CMD: bash
255+
256+
dev-container-status:
257+
desc: Check status of the development container
258+
cmds:
259+
- |
260+
if docker ps --format "table {{ '{{.Names}}' }}" | grep -q "^{{ '{{.PROJECT_SLUG}}' }}-dev$"; then
261+
echo "✅ Development container '{{ '{{.PROJECT_SLUG}}' }}-dev' is running"
262+
else
263+
echo "❌ Development container '{{ '{{.PROJECT_SLUG}}' }}-dev' is not running"
264+
echo "Run 'task dev-container' to start it"
265+
fi
266+
242267
clean:
243268
desc: Clean up build artifacts, cache files/directories, temp files, etc.
244269
cmds:

0 commit comments

Comments
 (0)