From 0924b1a7c81a426892984210caa10e741f7738da Mon Sep 17 00:00:00 2001 From: Nadav Timor Date: Mon, 24 Jun 2024 17:45:12 -0400 Subject: [PATCH] Devcontainer (#10) add a devcontainer --- .devcontainer/Dockerfile | 43 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 13 ++++++++++ .python-version | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..293873e --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,43 @@ +FROM mcr.microsoft.com/devcontainers/base:jammy + +ARG DEBIAN_FRONTEND=noninteractive +ARG USER=vscode + +RUN DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get install -y build-essential --no-install-recommends make \ + ca-certificates \ + git \ + libssl-dev \ + zlib1g-dev \ + libbz2-dev \ + libreadline-dev \ + libsqlite3-dev \ + wget \ + curl \ + llvm \ + libncurses5-dev \ + xz-utils \ + tk-dev \ + libxml2-dev \ + libxmlsec1-dev \ + libffi-dev \ + liblzma-dev + +# Python and poetry installation +USER $USER +ARG HOME="/home/$USER" +ARG PYTHON_VERSION=3.10 + +ENV PYENV_ROOT="${HOME}/.pyenv" +ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${HOME}/.local/bin:$PATH" + +RUN echo "done 0" \ + && curl https://pyenv.run | bash \ + && echo "done 1" \ + && pyenv install ${PYTHON_VERSION} \ + && echo "done 2" \ + && pyenv global ${PYTHON_VERSION} \ + && echo "done 3" \ + && curl -sSL https://install.python-poetry.org | python3 - \ + && poetry config virtualenvs.in-project true \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..1dc7ab0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,13 @@ +{ + "name": "poetry3-poetry-pyenv", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ] + } + } +} \ No newline at end of file diff --git a/.python-version b/.python-version index 1445aee..9dfc796 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.10.14 +3.10.14 \ No newline at end of file