Skip to content

Commit

Permalink
Speed up devcontainer build
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksis committed Nov 17, 2023
1 parent fc676d2 commit e3d7f04
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM mcr.microsoft.com/devcontainers/jekyll:2-bullseye
LABEL org.opencontainers.image.source https://github.com/oleksis/blackpythondevs.com
LABEL org.opencontainers.image.description "Black Python Developers website."

ARG PYTHON_VERSION="3.11.6"
ENV VERSION=${PYTHON_VERSION}

Expand All @@ -13,3 +16,5 @@ RUN /usr/local/python/${PYTHON_VERSION}/bin/python3 -m pip install --no-cache-di
&& /usr/local/python/${PYTHON_VERSION}/bin/python3 -m playwright install --with-deps

COPY --chmod=0755 .devcontainer/post-create-bpdevs.sh /usr/local/post-create-bpdevs.sh

EXPOSE 4000/tcp
34 changes: 34 additions & 0 deletions .devcontainer/codespaces/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "BPDevs",
"image": "ghcr.io/oleksis/blackpythondevs.com:latest",
"prebuild": true,
"prebuildCommand": "bundle install",
"prebuildVariants": [
{
"name": "development",
"prebuildCommand": "bundle install && JEKYLL_ENV=development bundle exec jekyll build"
}
],

"appPort": "4000:4000",
"forwardPorts": [
// Jekyll server
4000,
// Live reload server
35729
],

// Uncomment the next line to run commands after the container is created.
// git config --global --add safe.directory /workspaces/blackpythondevs.github.io
"postCreateCommand": "sh /usr/local/post-create-bpdevs.sh",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": ["DavidAnson.vscode-markdownlint"]
}
},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// "image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
"build": {
"dockerfile": "Dockerfile",
"cacheFrom": "ghcr.io/oleksis/blackpythondevs.com:latest",
"context": ".."
},

Expand Down

0 comments on commit e3d7f04

Please sign in to comment.