We recommend using Docker to get your project setup from the beginning. This ensures that you have a stable development environment, no matter what OS or system you're using to develop.
It also allows you to troubleshoot and debug the application since the development container is small and simple with very few dependencies.
First, you'll need to install Docker. You can download it from Docker's website.
You'll also need Just, the command
runner we use for every shortcut in the justfile. Install it with your
package manager — for example brew install just on macOS — or follow
the
installation instructions
for other platforms.
Once both are installed, create a new directory for your project:
mkdir -p ~/Development/mycompany/myproject
cd ~/Development/mycompany/myproject
Look in the examples directory of the LocoMotion
repository
for these basic configuration files:
| File | Purpose |
|---|---|
docker-compose.yml
| Defines your application services |
Dockerfile
| Instructions for building your app container |
dev/Dockerfile
| Development environment container |
entrypoint.sh
| Script that runs when containers start |
justfile
| Shortcuts for common commands |
Copy these files into your project directory. Your directory structure should look like this:
~/Development
└── mycompany
└── myproject
├── Dockerfile
├── justfile
├── dev
│ └── Dockerfile
├── docker-compose.yml
└── entrypoint.shWith these files in place, you can now start your development environment:
just dev
This command will build and run all the necessary containers. Once they have started, open a shell in your development container with:
just dev-shell
With the containers built and a shell open via just dev-shell, your
development environment is ready — consistent across any OS, simple to
debug, and isolated from your host system's dependencies.
From here, the Rails Setup guide picks up
exactly where this one leaves off: creating the Rails app with
rails new, configuring the database, and applying the
LocoMotion-recommended setup (UUIDs, HAML, DaisyUI, and more).
Create virtual credit / debit cards to keep your real info safe.
Get $5 when you sign up — free to start!
Everything you need to grow your business with confidence!
CRM, Lead Generation, Project Management, Contracts, Online Payments, and more!
The ads above are affiliate links to products I regularly use and highly
recommend.
I may receive a commission if you decide to purchase.