add deploy.sh and docker-compose

This commit is contained in:
2025-11-08 22:43:25 +07:00
parent cef697877a
commit 1d54765b32
2 changed files with 28 additions and 0 deletions

17
deploy.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -e
cd /home/dilanka/my_website
echo "==> Pulling latest code..."
git pull origin main
echo "==> Rebuilding Docker image..."
docker compose down
docker compose build --no-cache
docker compose up -d
echo "==> Cleanup..."
docker system prune -f
echo "✅ Deploy complete!"

11
docker-compose.yml Normal file
View File

@@ -0,0 +1,11 @@
version: "3.9"
services:
web:
build: .
container_name: go_htmx_app
ports:
- "8080:8080"
volumes:
- ./my_website.db:/app/my_website.db
restart: unless-stopped