jmanhype commited on
Commit
ee522dc
Β·
1 Parent(s): d352675

fix: properly create entrypoint script and test app

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -4
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM ubuntu:22.04
2
 
3
- # Force rebuild timestamp: 2024-12-05 20:05
4
  LABEL MAINTAINER="jmanhype"
5
  LABEL Description="Test dockerfile for Hugging Face Space"
6
 
@@ -36,11 +36,26 @@ RUN git config --global user.email "[email protected]" && \
36
  git config --global user.name "jmanhype"
37
 
38
  # Create a simple test Python app
39
- RUN echo 'import gradio as gr\n\ndef greet(name):\n return f"Hello {name}!"\n\ndemo = gr.Interface(fn=greet, inputs="text", outputs="text")\n\nif __name__ == "__main__":\n demo.launch(server_name="0.0.0.0", server_port=7860)' > $HOME/app/test_app.py
 
 
 
 
 
 
 
 
 
 
40
 
41
  # Create and set up entrypoint script
42
- RUN echo '#!/bin/bash\necho "Starting Gradio test app..."\npython3 test_app.py' > $HOME/entrypoint.sh && \
43
- chmod +x $HOME/entrypoint.sh
 
 
 
 
 
44
 
45
  EXPOSE 7860
46
 
 
1
  FROM ubuntu:22.04
2
 
3
+ # Force rebuild timestamp: 2024-12-05 20:20
4
  LABEL MAINTAINER="jmanhype"
5
  LABEL Description="Test dockerfile for Hugging Face Space"
6
 
 
36
  git config --global user.name "jmanhype"
37
 
38
  # Create a simple test Python app
39
+ COPY <<-'EOT' $HOME/app/test_app.py
40
+ import gradio as gr
41
+
42
+ def greet(name):
43
+ return f"Hello {name}!"
44
+
45
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
46
+
47
+ if __name__ == "__main__":
48
+ demo.launch(server_name="0.0.0.0", server_port=7860)
49
+ EOT
50
 
51
  # Create and set up entrypoint script
52
+ COPY <<-'EOT' $HOME/entrypoint.sh
53
+ #!/bin/bash
54
+ echo "Starting Gradio test app..."
55
+ python3 test_app.py
56
+ EOT
57
+
58
+ RUN chmod +x $HOME/entrypoint.sh
59
 
60
  EXPOSE 7860
61