Skip to content

Commit

Permalink
much smaller docker devcontainer
Browse files Browse the repository at this point in the history
- reduces size from 1.5GB to 500MB
  • Loading branch information
casperdcl committed Aug 17, 2023
1 parent 50d1374 commit 1e5f6aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"}}
}
8 changes: 8 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1e5f6aa

Please sign in to comment.