xdragxt commited on
Commit
95c40e2
·
verified ·
1 Parent(s): edf25b0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -20,24 +20,24 @@ COPY . /app
20
  # Set permissions for non-root user
21
  RUN chown -R user:user /app
22
 
23
- # Create startup script that logs tmate link
24
- RUN cat << 'EOF' > /app/start.sh
25
  #!/bin/bash
26
 
27
- # Start tmate in the background and write output to log
28
  tmate -F > /tmp/tmate.log 2>&1 &
29
 
30
- # Wait for tmate to initialize
31
  sleep 2
32
 
33
- # Print the SSH/web link from the tmate log
34
  grep -E "ssh|web|https" /tmp/tmate.log || tail -n 20 /tmp/tmate.log
35
 
36
- # Start FastAPI app
37
  exec uvicorn main:app --host 0.0.0.0 --port 7860
38
- EOF
39
 
40
- # Make the script executable
41
  RUN chmod +x /app/start.sh
42
 
43
  # Switch to non-root user
 
20
  # Set permissions for non-root user
21
  RUN chown -R user:user /app
22
 
23
+ # Create startup script using proper heredoc
24
+ RUN bash -c 'cat <<EOF > /app/start.sh
25
  #!/bin/bash
26
 
27
+ # Start tmate in background and log output
28
  tmate -F > /tmp/tmate.log 2>&1 &
29
 
30
+ # Wait for tmate to start
31
  sleep 2
32
 
33
+ # Show SSH/Web link in logs
34
  grep -E "ssh|web|https" /tmp/tmate.log || tail -n 20 /tmp/tmate.log
35
 
36
+ # Run FastAPI
37
  exec uvicorn main:app --host 0.0.0.0 --port 7860
38
+ EOF'
39
 
40
+ # Make script executable
41
  RUN chmod +x /app/start.sh
42
 
43
  # Switch to non-root user