I wanted a seamless way to switch between devices while coding (macbookpro / imac / ipad).
-
VSCode offers a remote SSH feature which allows your local VScode editor to remotely edit code, run terminals ... which is perfect for computers.
-
coder.com also offers a feature to make a full featured VSCode environment run in your browser or as a PWA (which can be helpful from an iPad)
This project will help at setting up a ubuntu VPS with :
- Docker
- code-server
- elixir (with asdf)
- chromedriver
- node (with nvm)
- postgresql
- nginx as a reverse proxy in front of code-server, webpack and your project
- various shell things such as ohmyzsh, autojump, tmux or direnv
Guidelines to provision a development server with Ansible
-
first, provision a VPS from any cloud vendor (I use a Digital Ocean $40/mo VPS with Ubuntu 18.04)
-
make sure you can root ssh to your newly created VPS
-
register following domain names all set with
A record
to your VPS IPssh.mydomain.com
used by you or ansible to ssh to your VPSvscode.mydomain.com
to access code-server web interfacewebpack.mydomain.com
to reach webpack dev server, that will hot render assetsmyproject.mydomain.com
to reach your dev server
-
locally install ansible:
brew install ansible
. -
create an ansible config file in
~/.ansible.cfg
.[defaults] inventory = ~/.ansible/hosts
-
create an ansible inventory in
~/.ansible/hosts
- create an ansible inventory in~/.ansible/hosts
.ssh.mydomain.com
-
copy
variables/all.template.yml
tovariables/all.yml
and change variables to your convenience. -
run
ansible-playbook playbook.yml
.