pachet commited on
Commit
0535b3d
·
1 Parent(s): 1be2827

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -18
Dockerfile CHANGED
@@ -1,34 +1,34 @@
1
- FROM python:3.11
 
2
 
3
- # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  git cmake g++ pkg-config curl swig make \
6
  libglib2.0-dev libxml2-dev libzip-dev \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- # Install Python dependencies
10
- RUN pip install --upgrade pip setuptools wheel build gradio lxml
11
-
12
- # Build Verovio from source
13
  WORKDIR /verovio
14
- RUN git clone --recurse-submodules https://github.com/rism-digital/verovio.git . && \
15
- git checkout tags/version-5.0.0 -b v5.0.0 && \
16
- git submodule update --init --recursive
17
 
18
- # Compile the C++ core with Python bindings
19
  WORKDIR /verovio/tools
20
- RUN cmake ../cmake -DWITH_PYTHON=ON -DCMAKE_BUILD_TYPE=Release && \
21
- make -j$(nproc) && \
22
- make install
23
 
24
- # Install the Python package from root (where setup.py is)
25
  WORKDIR /verovio
26
- RUN pip install verovio
 
 
 
 
27
 
28
- # Copy your Gradio app
29
  WORKDIR /app
30
- COPY app.py .
31
- COPY example.mei .
32
 
 
33
  EXPOSE 7860
34
  CMD ["python", "app.py"]
 
1
+ # Use a Python 3.11 base image
2
+ FROM python:3.11-slim
3
 
4
+ # Install necessary dependencies for building Verovio and Python bindings
5
  RUN apt-get update && apt-get install -y \
6
  git cmake g++ pkg-config curl swig make \
7
  libglib2.0-dev libxml2-dev libzip-dev \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
+ # Clone the Verovio repository and its submodules
 
 
 
11
  WORKDIR /verovio
12
+ RUN git clone --recurse-submodules https://github.com/rism-digital/verovio.git .
 
 
13
 
14
+ # Build the command-line tool (Verovio C++ code)
15
  WORKDIR /verovio/tools
16
+ RUN cmake ../cmake -DWITH_PYTHON=ON -DCMAKE_BUILD_TYPE=Release \
17
+ && make -j$(nproc) \
18
+ && make install
19
 
20
+ # Build and install the Python bindings for Verovio
21
  WORKDIR /verovio
22
+ RUN python3 setup.py build_ext --inplace \
23
+ && python3 setup.py install
24
+
25
+ # Install Python dependencies (gradio, etc.)
26
+ RUN pip install gradio
27
 
28
+ # Set up the working directory for your app
29
  WORKDIR /app
30
+ COPY app.py example.mei /app/
 
31
 
32
+ # Expose port 7860 and run the app
33
  EXPOSE 7860
34
  CMD ["python", "app.py"]