juancopi81's picture
Add SPACE_ID to docker file
c2cadeb
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"]