Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +45 -0
Dockerfile
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:24.04
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
## Install dependencies
|
6 |
+
RUN rm -rf /var/lib/apt/lists/* && \
|
7 |
+
apt-get clean && \
|
8 |
+
apt-get update && \
|
9 |
+
apt-get install --fix-missing -y wget unzip curl || apt-get install -y -f && \
|
10 |
+
apt-get clean
|
11 |
+
|
12 |
+
## Download and install Audiveris deb package once patched
|
13 |
+
|
14 |
+
RUN wget https://github.com/Audiveris/audiveris/releases/download/5.6.1/Audiveris-5.6.1-ubuntu24.04-x86_64.deb
|
15 |
+
|
16 |
+
## Patch the deb package to work without GUI
|
17 |
+
# Unpack the .deb
|
18 |
+
RUN dpkg-deb -R Audiveris-5.6.1-ubuntu24.04-x86_64.deb /tmp/audiveris
|
19 |
+
|
20 |
+
# Disable post-install script (replace with no-op)
|
21 |
+
RUN echo -e '#!/bin/sh\nexit 0' > /tmp/audiveris/DEBIAN/postinst
|
22 |
+
RUN chmod +x /tmp/audiveris/DEBIAN/postinst
|
23 |
+
|
24 |
+
# Repack the deb
|
25 |
+
RUN dpkg-deb -b /tmp/audiveris /tmp/audiveris-fixed.deb
|
26 |
+
|
27 |
+
# Install the modified deb
|
28 |
+
RUN apt-get install --fix-missing -y /tmp/audiveris-fixed.deb || apt-get install --fix-missing -y -f
|
29 |
+
|
30 |
+
|
31 |
+
RUN rm Audiveris-5.6.1-ubuntu24.04-x86_64.deb
|
32 |
+
|
33 |
+
## Install Gradio MCP
|
34 |
+
RUN apt-get install --fix-missing -y python3 python3-pip || apt-get install -y -f
|
35 |
+
# TODO: use a python virtual environment
|
36 |
+
RUN pip install --break-system-packages gradio[mcp]
|
37 |
+
|
38 |
+
## Clean
|
39 |
+
RUN apt-get clean
|
40 |
+
|
41 |
+
## Copy MCP server and execute it
|
42 |
+
COPY app.py /app/app.py
|
43 |
+
WORKDIR /app
|
44 |
+
|
45 |
+
CMD ["python3", "app.py"]
|