Skip to content

Instantly share code, notes, and snippets.

@rossedman
Created April 5, 2020 16:12
Show Gist options
  • Save rossedman/b2712d892cb969713fa63ef8c5c228ef to your computer and use it in GitHub Desktop.
Save rossedman/b2712d892cb969713fa63ef8c5c228ef to your computer and use it in GitHub Desktop.
[Unit]
Description=VSCode server for internal network and vpn
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop vscode
ExecStartPre=-/usr/bin/docker rm vscode
ExecStartPre=/usr/bin/docker pull codercom/code-server:latest
ExecStart=/usr/bin/docker run --rm \
--name vscode \
-p 0.0.0.0:8080:8080 \
-e PASSWORD=password \
-v "$HOME/Code:/home/coder/project" \
-v "/var/run/docker.sock:/var/run/docker.sock" \
codercom/code-server
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment