chore: cleanup and unify start.sh

- Remove docker-compose.yml (using podman/quadlet now)
- Remove my-auth.json (temporary auth file)
- Remove verify_frontend.sh (functionality in start.sh)
- Add Docker build option (a) to start.sh menu
- Add Forgejo registry push option (b) to start.sh menu
This commit is contained in:
Tiago Yamamoto 2026-01-02 08:53:47 -03:00
parent 6cd8c02252
commit 76e9845261
4 changed files with 63 additions and 84 deletions

View file

@ -1,73 +0,0 @@
version: '3.8'
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-postgres}
- DB_NAME=${DB_NAME:-gohorsejobs}
- JWT_SECRET=${JWT_SECRET:-secret}
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000}
depends_on:
- db
restart: unless-stopped
networks:
- app-network
backoffice:
build:
context: ./backoffice
dockerfile: Dockerfile
ports:
- "3001:3001"
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USERNAME=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-postgres}
- DB_DATABASE=${DB_NAME:-gohorsejobs}
- JWT_SECRET=${JWT_SECRET:-secret}
depends_on:
- db
restart: unless-stopped
networks:
- app-network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8080}
ports:
- "3000:3000"
depends_on:
- backend
restart: unless-stopped
networks:
- app-network
db:
image: postgres:15-alpine
environment:
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_PASSWORD=${DB_PASSWORD:-postgres}
- POSTGRES_DB=${DB_NAME:-gohorsejobs}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- app-network
volumes:
postgres_data:
networks:
app-network:
driver: bridge

View file

@ -1,7 +0,0 @@
{
"auths": {
"rg.fr-par.scw.cloud/saveinmed": {
"auth": "bm9sb2dpbjpmZTNhNmI1OC0zYjIyLTQyZDMtOGEwMi05ZTUyMTg3OWNmMzc="
}
}
}

View file

@ -44,8 +44,12 @@ echo -e ""
echo -e " ${CYAN}── Fast Options ──${NC}"
echo -e " ${YELLOW}8)${NC} ⚡ Seed Reset LITE (skip 153k cities)"
echo -e " ${YELLOW}9)${NC} 🔬 Run All Tests (Backend + Frontend)"
echo -e ""
echo -e " ${CYAN}── Docker/Deploy ──${NC}"
echo -e " ${YELLOW}a)${NC} 🐳 Build Docker Images"
echo -e " ${YELLOW}b)${NC} 🚀 Build & Push to Forgejo"
echo ""
read -p "Enter option [0-9]: " choice
read -p "Enter option [0-9,a,b]: " choice
case $choice in
1)
@ -275,5 +279,63 @@ case $choice in
echo -e "${RED}Invalid option. Exiting.${NC}"
exit 1
;;
a)
echo -e "\n${GREEN}🐳 Building Docker Images...${NC}\n"
REGISTRY="forgejo-gru.rede5.com.br/rede5"
echo -e "${BLUE}🔹 Building Backend...${NC}"
podman build -t $REGISTRY/gohorsejobs-backend:latest -f backend/Dockerfile backend/
echo -e "\n${BLUE}🔹 Building Frontend...${NC}"
podman build -t $REGISTRY/gohorsejobs-frontend:latest -f frontend/Dockerfile frontend/
echo -e "\n${BLUE}🔹 Building Seeder...${NC}"
podman build -t $REGISTRY/gohorsejobs-seeder:latest -f seeder-api/Dockerfile seeder-api/
echo -e "\n${GREEN}✅ All images built successfully!${NC}"
echo -e " ${CYAN}Backend:${NC} $REGISTRY/gohorsejobs-backend:latest"
echo -e " ${CYAN}Frontend:${NC} $REGISTRY/gohorsejobs-frontend:latest"
echo -e " ${CYAN}Seeder:${NC} $REGISTRY/gohorsejobs-seeder:latest"
;;
b)
echo -e "\n${GREEN}🚀 Building & Pushing to Forgejo Registry...${NC}\n"
REGISTRY="forgejo-gru.rede5.com.br/rede5"
# Check if logged in
echo -e "${BLUE}🔹 Checking registry login...${NC}"
if ! podman login --get-login $REGISTRY 2>/dev/null; then
echo -e "${YELLOW}⚠️ Not logged in. Please enter your credentials:${NC}"
read -p "Username: " REGISTRY_USER
read -s -p "Password/Token: " REGISTRY_PASS
echo ""
podman login forgejo-gru.rede5.com.br -u "$REGISTRY_USER" -p "$REGISTRY_PASS"
fi
echo -e "\n${BLUE}🔹 Building Backend...${NC}"
podman build -t $REGISTRY/gohorsejobs-backend:latest -f backend/Dockerfile backend/
echo -e "\n${BLUE}🔹 Building Frontend...${NC}"
podman build -t $REGISTRY/gohorsejobs-frontend:latest -f frontend/Dockerfile frontend/
echo -e "\n${BLUE}🔹 Building Seeder...${NC}"
podman build -t $REGISTRY/gohorsejobs-seeder:latest -f seeder-api/Dockerfile seeder-api/
echo -e "\n${BLUE}🔹 Pushing Backend...${NC}"
podman push $REGISTRY/gohorsejobs-backend:latest
echo -e "\n${BLUE}🔹 Pushing Frontend...${NC}"
podman push $REGISTRY/gohorsejobs-frontend:latest
echo -e "\n${BLUE}🔹 Pushing Seeder...${NC}"
podman push $REGISTRY/gohorsejobs-seeder:latest
echo -e "\n${GREEN}✅ All images built and pushed!${NC}"
echo -e " ${CYAN}Registry:${NC} $REGISTRY"
echo -e " ${CYAN}Images:${NC} gohorsejobs-backend, gohorsejobs-frontend, gohorsejobs-seeder"
;;
esac

View file

@ -1,3 +0,0 @@
#!/bin/bash
cd frontend
npm run build