-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds custom dev container configuration (#84)
Note that this does not having podman installed and does not support working on or running the end to end tests. Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
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,30 @@ | ||
FROM quay.io/fedora/fedora:37 | ||
|
||
ARG POETRY_VERSION=1.5.1 | ||
|
||
RUN dnf -y update && \ | ||
yum -y reinstall shadow-utils && \ | ||
yum install -y git \ | ||
python3 \ | ||
python3-pip \ | ||
python3-devel \ | ||
gcc-c++ && \ | ||
rm -rf /var/cache /var/log/dnf* /var/log/yum.* | ||
|
||
RUN useradd -u 1000 trestlebot | ||
|
||
ENV HOME=/home/trestlebot | ||
ENV PYSETUP_PATH="$HOME/trestle-bot" \ | ||
VENV_PATH="$HOME/trestle-bot/.venv" | ||
|
||
RUN mkdir -p "$PYSETUP_PATH" | ||
|
||
# Installing poetry and pipx. | ||
RUN python3 -m pip install --no-cache-dir --upgrade pip \ | ||
&& python3 -m pip install --no-cache-dir pipx \ | ||
&& python3 -m pipx install poetry==$POETRY_VERSION | ||
|
||
# set permissions | ||
RUN chown trestlebot:trestlebot -R /home/trestlebot | ||
|
||
USER trestlebot |
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,35 @@ | ||
{ | ||
"name": "TrestleBot Dev Environment ", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": ".." | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.linting.enabled": true, | ||
"python.defaultInterpreterPath": "/home/trestlebot/trestle-bot/.venv/bin/python3" | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.mypy-type-checker", | ||
"ms-python.flake8", | ||
"ms-python.isort", | ||
"ms-azuretools.vscode-docker" | ||
] | ||
} | ||
}, | ||
"updateRemoteUserUID": true, | ||
"containerUser": "trestlebot", | ||
"containerEnv": { | ||
"HOME": "/home/trestlebot", | ||
"PIP_NO_CACHE_DIR": "off", | ||
"PIP_DISABLE_PIP_VERSION_CHECK": "on", | ||
"PIP_DEFAULT_TIMEOUT": "100", | ||
"POETRY_VIRTUALENVS_IN_PROJECT": "true" | ||
}, | ||
"updateContentCommand": "python3 -m venv $VENV_PATH && source $VENV_PATH/bin/activate && poetry install --no-root --no-interaction", | ||
"postCreateCommand": "echo \"source $VENV_PATH/bin/activate\" >> $HOME/.bashrc", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind", | ||
"workspaceFolder": "/workspace" | ||
} |