-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·26 lines (22 loc) · 851 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·26 lines (22 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# RateLock — production deploy helper for a single EC2 instance.
# Runs the base compose + prod overlay with the prod env file.
#
# ./deploy.sh up # build & start everything (default)
# ./deploy.sh down # stop everything
# ./deploy.sh logs # tail all logs
# ./deploy.sh ps # status
set -euo pipefail
cd "$(dirname "$0")"
COMPOSE=(docker compose -f docker-compose.yml -f docker-compose.prod.yml --env-file .env.prod)
if [[ ! -f .env.prod ]]; then
echo "ERROR: .env.prod not found. Copy .env.prod.example to .env.prod and fill in secrets." >&2
exit 1
fi
case "${1:-up}" in
up) "${COMPOSE[@]}" up -d --build; "${COMPOSE[@]}" ps ;;
down) "${COMPOSE[@]}" down ;;
logs) "${COMPOSE[@]}" logs -f ;;
ps) "${COMPOSE[@]}" ps ;;
*) echo "usage: $0 {up|down|logs|ps}" >&2; exit 1 ;;
esac