Skip to content

Instantly share code, notes, and snippets.

@oleksis
Last active March 11, 2024 10:53
Show Gist options
  • Save oleksis/3dae07876c5de06a13729960270ddf6f to your computer and use it in GitHub Desktop.
Save oleksis/3dae07876c5de06a13729960270ddf6f to your computer and use it in GitHub Desktop.
BPDevs Codespaces

BPDevs Codespaces

Dev Container for the Black Python Developers website

Topics

  • Devcontainer (Dockerfile, Codespaces BPDevs)
    • DevContainers-Codespaces.md
    • Build (use containerd for pulling and storing images):
      • docker buildx build -f .github\.devcontainer\Dockerfile --push -t ghcr.io/oleksis/blackpythondevs.com:latest .
  • VS Code Profile: BPDevs
    • Jtree : jtree https://gist.githubusercontent.com/oleksis/ac4b7b4e3abed1a40de008721fe0233b/raw/800db6caf5d31bb339f21b5e200c5eb8385b0210/BPDevs

Demo

  • Live code session fix the CSS ".social-media-list li a" padding in the footer for the social icons
# docker build --no-cache -f .github\.devcontainer\Dockerfile -t ghcr.io/oleksis/blackpythondevs.com:latest .
devcontainer build --config .github\.devcontainer\devcontainer.json --workspace-folder . --push true --image-name ghcr.io/oleksis/blackpythondevs.com:latest
devcontainer up --config .github\.devcontainer\devcontainer.json --workspace-folder .
cd /workspaces/blackpythondevs.com/

# cat /etc/hosts                     
# ...
# 172.17.0.2      08681bd792da

# Add Nginx reverse proxy configuration
# https://github.com/oleksis/blackpythondevs.com/commit/e142ce7a3ffc437f342e7e6a250079c3ced2aafb
bundle exec jekyll serve -H 0.0.0.0

# python -m http.server -d _site/ -b 0.0.0.0 80

WSL2

➜ netsh interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress=10.0.0.108
➜ netsh interface portproxy add v4tov4 listenport=80 listenaddress=10.0.0.108 connectport=80 connectaddress=127.0.0.1

➜ netsh interface portproxy show all

Black Python Devs website

  • Development Workflow
docker build  -f .github\.devcontainer\Dockerfile -t ghcr.io/oleksis/blackpythondevs.com:latest .
devcontainer up --config .github\.devcontainer\devcontainer.json --workspace-folder .

Infraestructure

  • Local Development
docker compose -f ./docker-compose.yml up
# Changes
git push

RVM (Ruby Version Manager)

# rvm --default use 3.2.2
rvm install "ruby-3.2.2"
rvm --default use 3.2.2
git rm -f Gemfile.lock 
bundle install
bundle exec jekyll serve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment