Qosmo commited on
Commit
0cb29a5
β€’
1 Parent(s): 433cacc

Added Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.8
2
+
3
+ USER root
4
+
5
+ RUN apt update
6
+ RUN apt upgrade -y
7
+ RUN apt install -y ffmpeg
8
+
9
+ # Get secret S3_BUCKET and output it to /test at buildtime
10
+ RUN --mount=type=secret,id=S3_BUCKET,mode=0444,required=true \
11
+ cat /run/secrets/S3_BUCKET > /test
12
+
13
+ # Get secret S3_KEY and output it to /test at buildtime
14
+ RUN --mount=type=secret,id=S3_KEY,mode=0444,required=true \
15
+ cat /run/secrets/S3_KEY > /test
16
+
17
+ # Get secret S3_SECRET and output it to /test at buildtime
18
+ RUN --mount=type=secret,id=S3_SECRET,mode=0444,required=true \
19
+ cat /run/secrets/S3_SECRET > /test
20
+
21
+ # Get secret GDRIVE_FILE_ID and output it to /test at buildtime
22
+ RUN --mount=type=secret,id=GDRIVE_FILE_ID,mode=0444,required=true \
23
+ cat /run/secrets/GDRIVE_FILE_ID > /test
24
+
25
+ RUN useradd -m -u 1000 user
26
+
27
+ USER user
28
+
29
+ ENV HOME=/home/user \
30
+ PATH=/home/user/.local/bin:$PATH
31
+
32
+ WORKDIR $HOME/app
33
+
34
+ RUN pip install --no-cache-dir gdown
35
+ RUN gdown $(cat /test)
36
+ RUN unzip MusicSearch-demo-code.zip
37
+ RUN cp -r MusicSearch-demo-code/* .
38
+
39
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
40
+
41
+ CMD ["python", "app.py"]