File size: 1,230 Bytes
f3fc5f2
85220e3
 
 
 
 
cca4c18
 
 
 
85220e3
8f37e44
743714f
 
8f37e44
 
 
743714f
 
 
 
 
 
8f37e44
85220e3
f3fc5f2
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
FROM ubuntu:20.04

WORKDIR /code

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

# 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

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"]