File size: 1,320 Bytes
1e7c7b7
 
a59e1e1
 
d59a577
a59e1e1
 
b70ff15
1e7c7b7
a59e1e1
 
0a3ce35
 
 
a59e1e1
0a3ce35
 
 
a59e1e1
 
 
0a3ce35
 
 
a59e1e1
 
 
 
 
 
0a3ce35
 
 
be8bd51
 
 
 
 
0a3ce35
 
 
a59e1e1
0a3ce35
 
 
a59e1e1
0a3ce35
 
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
46
47
48
49
#Grab python=3.9-slim-buster image
FROM python:3.9-slim-buster

# Copy code to container
COPY app /app

# RUN apt-get update
RUN apt-get update && apt-get install -y gcc bzip2 libc-dev g++ libc6 libc6-dev dpkg-dev build-essential wget libpython3-dev python3-dev python3-pip gcc sudo
# openldap-dev libffi-dev jpeg-dev zlib-dev libmemcached-dev ibxml2 libxslt libxslt-dev

# TA-Lib
# RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
COPY ta-lib-0.4.0-src.tar.gz ta-lib-0.4.0-src.tar.gz
RUN tar -xvzf ta-lib-0.4.0-src.tar.gz && \
  cd ta-lib/ && \
  ./configure --prefix=/usr --build=aarch64-unknown-linux-gnu && \
  sudo make && \
  sudo make install && \
  cd ..
RUN rm -R ta-lib ta-lib-0.4.0-src.tar.gz

# Copy requirements to container
COPY app/requirements.txt /app/requirements.txt

# Move working directory
WORKDIR /app

# Install python depencies
RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -q -r requirements.txt

# Copy code to container
COPY app /app

# Give container write permission to sqlite db
RUN sudo chmod 774 /app/dataset/ihsg.db

# Update database
RUN python3 update_database.py

# Expose port 5000
EXPOSE 5000 		

# # Run the image as a non-root user
# RUN adduser myuser
# USER myuser

# Run the app on port 5000
CMD gunicorn --bind 0.0.0.0:5000 app:app