Skip to content
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

feat: adds dev container configuration files #84

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .devcontainer/Dockerfile
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
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
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"
}