diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8886e95 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..bcf1f8d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,63 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Tafrigh", + "dockerComposeFile": "docker-compose.yml", + "service": "app", + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/rocker-org/devcontainer-features/apt-packages:latest": { + "packages": "ffmpeg" + }, + "ghcr.io/devcontainers/features/git:latest": {}, + "ghcr.io/jungaretti/features/vim:latest": {}, + "ghcr.io/devcontainers/features/python:1": { + "version": "3.11" + }, + "ghcr.io/devcontainers/features/common-utils:latest": { + "username": "vscode", + "uid": 1000, + "gid": 1000, + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "upgradePackages": true + } + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": ".devcontainer/setup.sh", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "settings": { + "workbench": { + "iconTheme": "vscode-icons" + }, + "editor": { + "formatOnSave": true, + "rulers": [80, 120] + } + }, + "extensions": [ + "KevinRose.vsc-python-indent", + "Postman.postman-for-vscode", + "eamodio.gitlens", + "ms-python.debugpy", + "ms-python.python", + "ms-python.vscode-pylance", + "vscode-icons-team.vscode-icons", + "waderyan.gitblame" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..a5c0d5e --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' + +services: + app: + build: + context: .. + dockerfile: .devcontainer/Dockerfile + + volumes: + - ../..:/workspaces:cached + - $HOME/.ssh/:/home/vscode/.ssh/ + + # Overrides default command so things don't shut down after the process ends. + command: sleep infinity diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 0000000..1556106 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,3 @@ +curl -sSL https://install.python-poetry.org | python - +poetry config virtualenvs.create false +poetry install