Skip to content

Commit 08972a1

Browse files
committed
Fix Docker container startup and CI test improvements
- Add --password argument to Dockerfile CMD to prevent interactive password prompt - Improve Docker container testing in CI with better error handling - Add proper container cleanup and status checking - Container now starts successfully without hanging on password input
1 parent fe76e75 commit 08972a1

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,23 @@ jobs:
7272
7373
- name: Test Docker container
7474
run: |
75-
docker run --rm -d --name test-container freegpt4-api:latest
76-
sleep 10
77-
docker logs test-container
75+
# Start the container
76+
docker run -d --name test-container -p 5500:5500 freegpt4-api:latest
77+
78+
# Wait for container to start
79+
echo "Waiting for container to start..."
80+
sleep 30
81+
82+
# Check if container is still running
83+
if docker ps | grep -q test-container; then
84+
echo "Container is running successfully"
85+
docker logs test-container
86+
else
87+
echo "Container failed to start or exited"
88+
docker logs test-container
89+
exit 1
90+
fi
91+
92+
# Cleanup
7893
docker stop test-container || true
94+
docker rm test-container || true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
6262

6363
# Default command
6464
ENTRYPOINT ["python", "FreeGPT4_Server.py"]
65-
CMD ["--enable-gui", "--enable-fast-api"]
65+
CMD ["--enable-gui", "--enable-fast-api", "--password", "admin123"]

0 commit comments

Comments
 (0)