Workspace with the tmux

Dawid Laszuk published on
1 min, 131 words

Most of my projects now are separated from the beginning into logical entities and put into docker. This makes the deployment and replacement much easier to manage but the development many rituals comands.

Tmux to the rescue. Being a terminal/cmdline guy I like to have all my logs and dashboards in one view. Code below is used to for Flask Python backend, React Javascript frontend and MongoDb.

#!/bin/sh
cd ~/project
sudo docker run -d -p 27017:27017 -v ~/project/db/mongo-data:/data/db mongo

tmux new-session -d -s Development -n server -c ~/project/server "./venv/bin/python server.py"
tmux split-window -v -c ~/project/client "yarn start"
tmux split-window -h -c ~/project/db "mongo"
tmux new-window 'mutt'
tmux -2 attach-session -d