File size: 1,006 Bytes
490ec84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

cd ~/late.io

# Create missing scripts directory with placeholder
mkdir -p scripts
touch scripts/__init__.py
cat <<EOF > scripts/execution_engine.py
def execute_agent_logic():
    pass
EOF

# Ensure Dockerfile explicitly uses port 7860 internally
cat <<EOF > Dockerfile
FROM python:3.11-slim

WORKDIR /app

COPY ./backend /app/backend
COPY ./routes /app/routes
COPY ./scripts /app/scripts
COPY requirements.txt /app/

RUN pip install --no-cache-dir --upgrade -r requirements.txt

EXPOSE 7860

CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]
EOF

# Remove any old containers and images
docker stop agentic-app || true
docker rm agentic-app || true
docker rmi agentic-app:latest -f || true

# Rebuild Docker image explicitly without cache
docker build --no-cache -t agentic-app:latest .

# Run the Docker container mapping port 7860 correctly
docker run -d -p 7860:7860 --name agentic-app agentic-app:latest

# Wait and verify
sleep 3
docker logs agentic-app
docker ps