Skip to content

Commit

Permalink
Add DevContainer setup
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Jun 26, 2024
1 parent 9a4a03e commit b4a61ea
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04
63 changes: 63 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 14 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
curl -sSL https://install.python-poetry.org | python -
poetry config virtualenvs.create false
poetry install

0 comments on commit b4a61ea

Please sign in to comment.