File size: 1,380 Bytes
2184431
85220e3
 
 
0168791
c2cadeb
0168791
85220e3
 
cca4c18
 
 
 
85220e3
b238b6d
743714f
 
8f37e44
 
 
743714f
 
 
 
 
 
8f37e44
85220e3
b2e5b51
 
 
f3fc5f2
85220e3
 
 
 
 
 
 
 
 
b238b6d
85220e3
 
 
 
 
 
 
f3fc5f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM ubuntu:20.04

WORKDIR /code

ENV SYSTEM=spaces
ENV SPACE_ID=juancopi81/multitrack-midi-music-generator

COPY ./requirements.txt /code/requirements.txt

# Preconfigure tzdata
RUN DEBIAN_FRONTEND="noninteractive" apt-get -qq update && \
    DEBIAN_FRONTEND="noninteractive" apt-get install -y tzdata

RUN apt-get update -qq && \
    apt-get install -qq python3-pip build-essential libasound2-dev libjack-dev wget cmake pkg-config libglib2.0-dev ffmpeg

# Download libfluidsynth source
RUN wget https://github.com/FluidSynth/fluidsynth/archive/refs/tags/v2.3.3.tar.gz && \
    tar xzf v2.3.3.tar.gz && \
    cd fluidsynth-2.3.3 && \
    mkdir build && \
    cd build && \
    cmake .. && \
    make && \
    make install && \
    cd ../../ && \
    rm -rf fluidsynth-2.3.3 v2.3.3.tar.gz

ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
RUN ldconfig

RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app

CMD ["python3", "main.py"]