-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-test.sh
More file actions
executable file
Β·57 lines (44 loc) Β· 1.33 KB
/
docker-test.sh
File metadata and controls
executable file
Β·57 lines (44 loc) Β· 1.33 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Docker Test Script for Codex2API
set -e
echo "π³ Codex2API Docker Test"
echo "========================"
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "β Docker is not running. Please start Docker and try again."
exit 1
fi
# Check if auth.json exists
if [ ! -f "auth.json" ]; then
echo "β auth.json not found. Please run 'uv run get_token.py' first."
exit 1
fi
echo "π¨ Building Docker image..."
docker build -t codex2api-test .
echo "β
Docker image built successfully"
echo "π Testing Docker container..."
# Run container in detached mode
CONTAINER_ID=$(docker run -d \
--name codex2api-test \
-p 8001:8000 \
-v $(pwd)/auth.json:/app/auth.json:ro \
-v $(pwd)/models.json:/app/models.json:ro \
codex2api-test)
echo "π Container ID: $CONTAINER_ID"
# Wait for container to start
echo "β³ Waiting for container to start..."
sleep 10
# Test health endpoint
echo "π Testing health endpoint..."
if curl -f http://localhost:8001/health > /dev/null 2>&1; then
echo "β
Health check passed"
else
echo "β Health check failed"
echo "π Container logs:"
docker logs codex2api-test
fi
# Cleanup
echo "π§Ή Cleaning up..."
docker stop codex2api-test > /dev/null 2>&1 || true
docker rm codex2api-test > /dev/null 2>&1 || true
echo "β
Docker test completed"