Sign inSign up

saracen9/coder

By saracen9

Updated over 4 years ago

VS Code container, customised for Python and VueJS development

Image
0

1.4K

saracen9/coder repository overview

saracen9/coder

A basic, customised, installation of cdr/code-server to provide a VS Code IDE in a web-browser. Designed to enable development from an iPad Pro for a generic stack that includes:

  • Python3
    • 3.9 (stable 3.9.11) and 3.10 (latest) configured with Pyenv)
  • FiraCode with Ligatures in VSCode
  • Zsh primary shell with Oh-My-Zsh
    • Starship theme
    • Auto suggestions
    • Syntax highlighting
  • VSCode extensions preinstalled for
    • Python
    • Docker
    • Jupyter
    • Vetur (Vue 3)
    • Other
      • Auto Close Tag
      • Auto Rename Tag
      • Better Comments
      • Code Spell Checker
      • Colorize
      • Community Material Theme
      • DotENV
      • GitLens
      • Import Cost
      • Live Server
      • Markdown All in One
      • Markdown Preview Enhanced
      • Markdown Table Prettifier
      • Markdown Lint
      • Material Theme
      • Material Theme Icons
      • Path Intellisense
      • Peacock
      • Prettier
      • Regex Previewer
      • Settings Sync
      • SQLTools
        • Driver: MySQL / MariaDB
        • Driver: MS SQL
        • Driver: PostgreSQL
        • Driver: SQLite
      • TODO Highlight
      • TODO Tree

Usage

The easiest way to get setup and running in a semi-production sense is to:

  • use Cloudflare for DNS:
    • enable HTTPS (not strict)
  • run the container with the following command
# This will start a code-server container and expose it at http://127.0.0.1:8080.
# It will also mount your current directory into the container as `/home/coder/project`
# and forward your UID/GID so that all file system operations occur as your user outside
# the container.
#
# Your $HOME/.config is mounted at $HOME/.config within the container to ensure you can
# easily access/modify your code-server config in $HOME/.config/code-server/config.json
# outside the container.
mkdir -p ~/.config
docker run -it --name code-server -p 127.0.0.1:8080:8080 \
  -v "$HOME/.config:/home/coder/.config" \
  -v "$PWD:/home/coder/project" \
  -u "$(id -u):$(id -g)" \
  -e "DOCKER_USER=$USER" \
  -e PASSWORD=mypassword \
saracen9/coder --cert

You can optionally run this with access to the host docker daemon as well so that docker commands (such as building) will work from within the VS Code terminal. Please ensure you're comfortable with the security implications of doing so.

mkdir -p ~/.config
docker run -it --name code-server -p 127.0.0.1:8080:8080 \
  -v "$HOME/.config:/home/coder/.config" \
  -v "$PWD:/home/coder/project" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /usr/bin/docker:/usr/bin/docker \
  -u "$(id -u):$(id -g)" \
  -e "DOCKER_USER=$USER" \
  -e PASSWORD=mypassword \
saracen9/coder --cert

NB: In order for certain extension functionality to work (ie. those that require service workers) as well as load remote resources you'll need to provide trusted certs by your browser (eg. LetsEncrypt).

Roadmap

These are features I'd like to have but haven't yet implemented.

  • Language support
    • Python 3
    • Vue 3 (JavaScript)
      • Vue 3
      • Vite (build and dev server)
      • Vitest (testing)
      • Pinia (state management)
      • Tailwind CSS
  • Enable ability to use docker from within the IDE for builds
  • Install appropriate extensions for VS Code
  • Set git config from environment variables

References

Tag summary

Content type

Image

Digest

Size

910.7 MB

Last updated

over 4 years ago

docker pull saracen9/coder