FROM python:3.8 USER root RUN apt update RUN apt upgrade -y RUN apt install -y ffmpeg # Get secret S3_BUCKET and output it to /test at buildtime RUN --mount=type=secret,id=S3_BUCKET,mode=0444,required=true \ cat /run/secrets/S3_BUCKET > /test # Get secret S3_KEY and output it to /test at buildtime RUN --mount=type=secret,id=S3_KEY,mode=0444,required=true \ cat /run/secrets/S3_KEY > /test # Get secret S3_SECRET and output it to /test at buildtime RUN --mount=type=secret,id=S3_SECRET,mode=0444,required=true \ cat /run/secrets/S3_SECRET > /test # Get secret GDRIVE_FILE_ID and output it to /test at buildtime RUN --mount=type=secret,id=GDRIVE_FILE_ID,mode=0444,required=true \ cat /run/secrets/GDRIVE_FILE_ID > /test RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app RUN pip install --no-cache-dir gdown RUN gdown $(cat /test) RUN unzip video2music-demo-code.zip RUN cp -r video2music-demo-code/* . RUN pip install --no-cache-dir --upgrade -r requirements.txt CMD ["python", "app.py"]