Skip to content

fix: docker configuration and build settings #10

fix: docker configuration and build settings

fix: docker configuration and build settings #10

Workflow file for this run

name: Docker Compose Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
docker-compose-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create .env file for Docker
run: |
cp .env.docker .env
echo "NODE_ENV=test" >> .env
- name: Start services with Docker Compose
run: docker-compose up -d
- name: Wait for services to be healthy
run: |
for i in {1..30}; do
echo "Attempt $i/30..."
docker-compose ps
BACKEND_HEALTH=$(docker-compose exec -T backend curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/health || echo "000")
FRONTEND_HEALTH=$(docker-compose exec -T frontend curl -s -o /dev/null -w "%{http_code}" http://localhost:80/health || echo "000")
if [ "$BACKEND_HEALTH" = "200" ] && [ "$FRONTEND_HEALTH" = "200" ]; then
echo "✅ All services are healthy!"
exit 0
fi
sleep 2
done
echo "❌ Services did not become healthy"
exit 1
- name: Test Backend API
run: |
echo "Testing Backend Health Endpoint..."
docker-compose exec -T backend curl -v http://localhost:3000/health
- name: Test Frontend
run: |
echo "Testing Frontend..."
docker-compose exec -T frontend curl -v http://localhost:80/health
- name: View service logs
if: failure()
run: |
echo "Backend logs:"
docker-compose logs backend
echo ""
echo "Frontend logs:"
docker-compose logs frontend
echo ""
echo "PostgreSQL logs:"
docker-compose logs postgres
- name: Cleanup
if: always()
run: docker-compose down -v