jmanhype
commited on
Commit
Β·
357dcd5
1
Parent(s):
ee522dc
fix: simplify script creation approach
Browse files- Dockerfile +17 -23
Dockerfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
FROM ubuntu:22.04
|
2 |
|
3 |
-
# Force rebuild timestamp: 2024-12-05 20:
|
4 |
LABEL MAINTAINER="jmanhype"
|
5 |
LABEL Description="Test dockerfile for Hugging Face Space"
|
6 |
|
@@ -35,28 +35,22 @@ RUN pip3 install --user gradio numpy
|
|
35 |
RUN git config --global user.email "[email protected]" && \
|
36 |
git config --global user.name "jmanhype"
|
37 |
|
38 |
-
# Create
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
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 |
|
62 |
-
CMD ["
|
|
|
1 |
FROM ubuntu:22.04
|
2 |
|
3 |
+
# Force rebuild timestamp: 2024-12-05 20:25
|
4 |
LABEL MAINTAINER="jmanhype"
|
5 |
LABEL Description="Test dockerfile for Hugging Face Space"
|
6 |
|
|
|
35 |
RUN git config --global user.email "[email protected]" && \
|
36 |
git config --global user.name "jmanhype"
|
37 |
|
38 |
+
# Create test files
|
39 |
+
RUN mkdir -p $HOME/app && cd $HOME/app && \
|
40 |
+
echo '#!/bin/bash' > entrypoint.sh && \
|
41 |
+
echo 'echo "Starting Gradio test app..."' >> entrypoint.sh && \
|
42 |
+
echo 'python3 test_app.py' >> entrypoint.sh && \
|
43 |
+
chmod +x entrypoint.sh && \
|
44 |
+
echo 'import gradio as gr' > test_app.py && \
|
45 |
+
echo '' >> test_app.py && \
|
46 |
+
echo 'def greet(name):' >> test_app.py && \
|
47 |
+
echo ' return f"Hello {name}!"' >> test_app.py && \
|
48 |
+
echo '' >> test_app.py && \
|
49 |
+
echo 'demo = gr.Interface(fn=greet, inputs="text", outputs="text")' >> test_app.py && \
|
50 |
+
echo '' >> test_app.py && \
|
51 |
+
echo 'if __name__ == "__main__":' >> test_app.py && \
|
52 |
+
echo ' demo.launch(server_name="0.0.0.0", server_port=7860)' >> test_app.py
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
EXPOSE 7860
|
55 |
|
56 |
+
CMD ["./entrypoint.sh"]
|