Files
3cloud-backend/tmux_1.sh
T
2025-06-29 09:26:38 +09:30

23 lines
714 B
Bash

#!/bin/bash
docker run --name theapi-redis-server -d --rm -p 6379:6379 redis
docker start theapi-mariadb-container && sleep 2
#Wait for MariaDB to start
# Create a new tmux session named "dev1"
tmux new-session -d -s dev1
# Split the window vertically
tmux split-window -v
# Run commands in the first pane (pane 0)
tmux send-keys -t dev1:0.0 'source .venv/bin/activate' C-m
tmux send-keys -t dev1:0.0 'python3 api_server.py' C-m # or whatever your dev command is
# Run commands in the second pane (pane 1)
tmux send-keys -t dev1:0.1 'source .venv/bin/activate' C-m
tmux send-keys -t dev1:0.1 'python -m websocket_server.main' C-m # or your editor of choice
# Attach to the tmux session
tmux attach -t dev1