diff --git a/.devcontainer.json b/.devcontainer.json index 6c6f8de..73578dc 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,12 +1,11 @@ // format details: https://aka.ms/devcontainer.json { "name": "book.premai.io", -"image": "mcr.microsoft.com/devcontainers/python:3-bullseye", +"build": {"dockerfile": ".github/Dockerfile", "context": "."}, "customizations": {"vscode": {"extensions": [ "DavidAnson.vscode-markdownlint", "streetsidesoftware.code-spell-checker" ]}}, -"postCreateCommand": "pip install --user -r requirements.txt", "postStartCommand": "jupyter-book build -W -n . && python -m http.server -d _build/html", "portsAttributes": {"8000": {"label": "Webserver", "onAutoForward": "notify"}} } diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 0000000..e7836d8 --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,8 @@ +FROM python:alpine +# required for `pip install psutil` +RUN apk update && apk add python3-dev gcc linux-headers musl-dev +# required for vscode +RUN apk update && apk add git +# project dependencies +COPY requirements.txt . +RUN pip install -r requirements.txt && rm requirements.txt