Skip to content

Commit ab9bec5

Browse files
YedPoolclaude
andcommitted
Fix Dockerfile syntax error with startup script creation
- Replace heredoc with echo commands to avoid Docker parsing issues - Maintains same functionality with proper escaping - Should resolve "unknown instruction: set" error in GitHub Actions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent fc0c062 commit ab9bec5

1 file changed

Lines changed: 32 additions & 34 deletions

File tree

cerebrium/Dockerfile

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,38 @@ COPY main.py .
2626
COPY *.py .
2727

2828
# Create startup script that runs both Ollama and our app
29-
RUN cat > /app/start.sh << 'EOF'
30-
#!/bin/bash
31-
set -e
32-
33-
echo "🚀 Starting Ollama + Voice Agent Container"
34-
35-
# Start Ollama in background
36-
echo "📦 Starting Ollama server..."
37-
ollama serve &
38-
OLLAMA_PID=$!
39-
40-
# Wait for Ollama to be ready
41-
echo "⏳ Waiting for Ollama to be ready..."
42-
for i in {1..30}; do
43-
if curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then
44-
echo "✅ Ollama is ready!"
45-
break
46-
fi
47-
echo " Attempt $i/30 - waiting..."
48-
sleep 2
49-
done
50-
51-
# Download the model we need
52-
echo "📥 Downloading llama3.2:1b model..."
53-
ollama pull llama3.2:1b
54-
55-
# Start our voice agent
56-
echo "🎤 Starting Voice Agent..."
57-
python main.py
58-
59-
# Clean shutdown
60-
trap 'kill $OLLAMA_PID' EXIT
61-
wait
62-
EOF
29+
RUN echo '#!/bin/bash' > /app/start.sh && \
30+
echo 'set -e' >> /app/start.sh && \
31+
echo '' >> /app/start.sh && \
32+
echo 'echo "🚀 Starting Ollama + Voice Agent Container"' >> /app/start.sh && \
33+
echo '' >> /app/start.sh && \
34+
echo '# Start Ollama in background' >> /app/start.sh && \
35+
echo 'echo "📦 Starting Ollama server..."' >> /app/start.sh && \
36+
echo 'ollama serve &' >> /app/start.sh && \
37+
echo 'OLLAMA_PID=$!' >> /app/start.sh && \
38+
echo '' >> /app/start.sh && \
39+
echo '# Wait for Ollama to be ready' >> /app/start.sh && \
40+
echo 'echo "⏳ Waiting for Ollama to be ready..."' >> /app/start.sh && \
41+
echo 'for i in {1..30}; do' >> /app/start.sh && \
42+
echo ' if curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then' >> /app/start.sh && \
43+
echo ' echo "✅ Ollama is ready!"' >> /app/start.sh && \
44+
echo ' break' >> /app/start.sh && \
45+
echo ' fi' >> /app/start.sh && \
46+
echo ' echo " Attempt $i/30 - waiting..."' >> /app/start.sh && \
47+
echo ' sleep 2' >> /app/start.sh && \
48+
echo 'done' >> /app/start.sh && \
49+
echo '' >> /app/start.sh && \
50+
echo '# Download the model we need' >> /app/start.sh && \
51+
echo 'echo "📥 Downloading llama3.2:1b model..."' >> /app/start.sh && \
52+
echo 'ollama pull llama3.2:1b' >> /app/start.sh && \
53+
echo '' >> /app/start.sh && \
54+
echo '# Start our voice agent' >> /app/start.sh && \
55+
echo 'echo "🎤 Starting Voice Agent..."' >> /app/start.sh && \
56+
echo 'python main.py' >> /app/start.sh && \
57+
echo '' >> /app/start.sh && \
58+
echo '# Clean shutdown' >> /app/start.sh && \
59+
echo 'trap '"'"'kill $OLLAMA_PID'"'"' EXIT' >> /app/start.sh && \
60+
echo 'wait' >> /app/start.sh
6361

6462
RUN chmod +x /app/start.sh
6563

0 commit comments

Comments
 (0)