|
| 1 | +// For format details, see https://aka.ms/devcontainer.json. For config options, see the |
| 2 | +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node |
| 3 | +{ |
| 4 | + "name": "StableStudio+WebUI GPU dev", |
| 5 | + "image": "mcr.microsoft.com/devcontainers/typescript-node:0-18", |
| 6 | + "postCreateCommand": "cd /home/node && git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git webui && cd webui && python -m venv ~/.webui-venv && bash -c 'source ~/.webui-venv/bin/activate' && pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && pip install -r requirements_versions.txt", |
| 7 | + // avoid git "dubious ownership" errors, which break yarn |
| 8 | + "postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder} && yarn", |
| 9 | + "postAttachCommand": "echo 'To start the backend, run: cd ~/webui; ./webui.sh'", |
| 10 | + "customizations": { |
| 11 | + "vscode": { |
| 12 | + "settings": { |
| 13 | + "python.defaultInterpreterPath": "/home/node/.webui-venv/stability-generator/bin/python" |
| 14 | + }, |
| 15 | + "extensions": [ |
| 16 | + "vscode.typescript-language-features" |
| 17 | + ] |
| 18 | + } |
| 19 | + }, |
| 20 | + "features": { |
| 21 | + "ghcr.io/devcontainers/features/nvidia-cuda:1": { |
| 22 | + "cudaVersion": "11.8", |
| 23 | + "installCudnn": true, |
| 24 | + "installNvtx": true |
| 25 | + }, |
| 26 | + "ghcr.io/devcontainers/features/python:1": { |
| 27 | + "version": "3.10.6" |
| 28 | + }, |
| 29 | + "ghcr.io/devcontainers-contrib/features/apt-get-packages:1": { |
| 30 | + "packages": "libgl1-mesa-glx" |
| 31 | + }, |
| 32 | + "ghcr.io/devcontainers/features/github-cli:1": { |
| 33 | + |
| 34 | + } |
| 35 | + }, |
| 36 | + "remoteEnv": { |
| 37 | + "COMMANDLINE_ARGS": "--nowebui --cors-allow-origins=http://localhost:3000", |
| 38 | + "venv_dir": "/home/node/.webui-venv" |
| 39 | + }, |
| 40 | + "runArgs": ["--gpus", "all"], |
| 41 | + "portsAttributes": { |
| 42 | + "3000": { |
| 43 | + "label": "Application", |
| 44 | + "onAutoForward": "openBrowserOnce" |
| 45 | + }, |
| 46 | + "7861": { |
| 47 | + "label": "Backend", |
| 48 | + "onAutoForward": "ignore" |
| 49 | + } |
| 50 | + } |
| 51 | +} |
0 commit comments