-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dev Container #233
Merged
Merged
Add Dev Container #233
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d2412d7
Add Dev Container
getjump 57529b2
Fix version
getjump ad3bdeb
fix: make help failure in the devcontainer
egregors 3b3287d
Fix gitignore
getjump 15f7556
Put dependencies into dev container
getjump 5f2c88f
Add markdown extension
getjump 917eef5
Updated README
getjump c3915e7
dev: cleanup
egregors 601c9e2
bump: 0.6.11
egregors 419ff1d
Merge branch 'master' into master
egregors File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/python-3/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster | ||
ARG VARIANT="3.9" | ||
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} | ||
|
||
RUN apt-get -y update && apt-get install -y ffmpeg | ||
|
||
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. | ||
# COPY requirements.txt /tmp/pip-tmp/ | ||
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ | ||
# && rm -rf /tmp/pip-tmp | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/python-3 | ||
{ | ||
"name": "Python 3", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": { | ||
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local on arm64/Apple Silicon. | ||
"VARIANT": "3.9", | ||
// Options | ||
"NODE_VERSION": "lts/*" | ||
} | ||
}, | ||
|
||
"remoteEnv": { | ||
"PATH": "/home/vscode/.local/bin:${containerEnv:PATH}" | ||
}, | ||
|
||
// Preserve shell history and stuff across rebuilds | ||
"mounts": [ | ||
"source=profile,target=/root,type=volume", | ||
"target=/root/.vscode-server,type=volume" | ||
], | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"python.defaultInterpreterPath": "/usr/local/bin/python", | ||
"python.linting.enabled": true, | ||
"python.linting.pylintEnabled": true, | ||
"python.formatting.blackPath": "/home/vscode/.local/bin/black", | ||
"python.linting.flake8Path": "/home/vscode/.local/bin/flake8", | ||
"python.linting.mypyPath": "/home/vscode/.local/bin/mypy", | ||
"python.linting.pycodestylePath": "/home/vscode/.local/bin/pycodestyle", | ||
"python.linting.pylintPath": "/home/vscode/.local/bin/pylint" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"mutantdino.resourcemonitor" | ||
], | ||
|
||
// 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": "pip3 install --user -r requirements.txt", | ||
"postCreateCommand": "/usr/local/bin/pip install pipenv==2021.5.29 && /usr/local/bin/python -m pipenv install --dev --system", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode", | ||
"features": { | ||
"git": "latest", | ||
"github-cli": "latest", | ||
"sshd": "latest", | ||
"docker-in-docker": { | ||
"version": "latest", | ||
"moby": true, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,8 +103,6 @@ venv.bak/ | |
# mypy | ||
.mypy_cache/ | ||
|
||
#vscode | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we can exclude only |
||
.vscode | ||
.history | ||
.env | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Bot", | ||
"type": "python", | ||
"request": "launch", | ||
"program": "bot/main.py", | ||
"cwd": "${workspaceRoot}", | ||
"preLaunchTask": "Run Bot Environment" | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": | ||
[ | ||
{ | ||
"label": "Run Bot Environment", | ||
"type": "docker-compose", | ||
"dockerCompose": { | ||
"up": { | ||
"detached": true, | ||
"build": true, | ||
"services": ["serving", "mongo"] | ||
}, | ||
"files": [ | ||
"${workspaceFolder}/docker-compose-dev.yml" | ||
] | ||
} | ||
} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like include deps into image is a good idea. We change them not so often.