Update Dockerfile
Browse files- 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
|
24 |
-
RUN cat <<
|
25 |
#!/bin/bash
|
26 |
|
27 |
-
# Start tmate in
|
28 |
tmate -F > /tmp/tmate.log 2>&1 &
|
29 |
|
30 |
-
# Wait for tmate to
|
31 |
sleep 2
|
32 |
|
33 |
-
#
|
34 |
grep -E "ssh|web|https" /tmp/tmate.log || tail -n 20 /tmp/tmate.log
|
35 |
|
36 |
-
#
|
37 |
exec uvicorn main:app --host 0.0.0.0 --port 7860
|
38 |
-
EOF
|
39 |
|
40 |
-
# Make
|
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
|