Cloud Development environments for LEMP stack using Android in Samoa
Cloud IDEs have exploded in recent times with the likes of Replit, Stackblitz and CodeSandbox. They allow you to code from any machine using only your browser and a stable internet connection. Many options favour Javascript (JS) frameworks such as Vue, React and Svelte. Yet, it's difficult to find support for a LEMP stack which uses Linux, Nginx, Mariadb/ MySQL and PHP.
Codespace for Cloud Dev environments using Docker Compose
Recently, I had to work from my phone so I looked at Cloud IDEs to code using Samsung Dex. I tried several options and chose Github Codespace.
Codespace lets you get started for free. Out of the box you have access to docker, docker compose, node and git from the terminal. You also have a VsCode Editor available. The repo I worked on was already set up for docker and docker compose. With this setup, Nginx, Mariadb and PHP all run in their own containers and use Docker Compose to communicate.
Getting started was a matter of cloning my repo from Github and issuing the docker compose up -d command. Next I logged into the php container, installed the composer packages and initialised my database.
Caveats
Mono-repo Setup
To access your app in a browser you need to expose specific ports. Codespace will map them to a unique URL you can use to access your app.
Hot reloads
Hot reloads do not work on Android. However it worked on the laptop it.
JS console
No JS console or ability to inspect elements on Android.
Gitlab
Evaluations
Gitpod
This looked promising and I was willing to pay. However it was impossible to verify my account from Samoa.
Codeanywhere
Codeanywhere also looked promising but it required you to sign up and pay an annual subscription. Not happening!
AWS Cloud9
This took a bit of fiddling and requires know some knowledge of AWS. It also comes with node and docker but missing docker compose. Furthermore there was no IDE support for Vscode.
Final words
Codespace gets you up and running quickly. Apart from minor caveats above I was able to code and have full access to my containers in the cloud.
Comments
Post a Comment