File size: 1,076 Bytes
0cb29a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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 MusicSearch-demo-code.zip
RUN cp -r MusicSearch-demo-code/* .

RUN pip install --no-cache-dir --upgrade -r requirements.txt

CMD ["python", "app.py"]