diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cd927eb6..63485dc3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-alpine +FROM library/python:3.12-bookworm LABEL maintainer="CFPB RegTech Team" @@ -6,24 +6,20 @@ COPY pyproject.toml . COPY poetry.lock . # install git and alpine sdk for c compiler extensions -RUN apk add --update git curl +RUN apt update && apt install -y git curl # install pip dependencies RUN pip install --upgrade pip RUN pip install poetry -# run poetry install -RUN poetry config virtualenvs.create false -RUN poetry install --no-root - # create a non root sbl user ARG USER=sbl ENV HOME /home/$USER # install sudo as root -RUN apk add --update sudo +RUN apt install sudo # add the new user -RUN adduser -D $USER \ +RUN adduser $USER \ && echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER \ && chmod 0440 /etc/sudoers.d/$USER diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1dc2c1ad..d1ad3d65 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,6 +3,11 @@ "dockerfile": "Dockerfile", "context": ".." }, + "runArgs": [ + "--mount", + "type=volume,target=/${containerWorkspaceFolder}/.venv" + ], + "postCreateCommand": "poetry install", "customizations": { "vscode": { "extensions": [