qywok commited on
Commit
9f4f02b
·
verified ·
1 Parent(s): a86f06e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +74 -42
Dockerfile CHANGED
@@ -1,71 +1,103 @@
1
- FROM python:3.11-bullseye
2
 
3
- LABEL organization="R6Q - Infraprasta University"
4
- LABEL team="Group 5"
5
 
6
- RUN useradd -m -u 1000 user
7
 
8
- WORKDIR /app
9
 
10
- COPY --chown=user ./requirements.txt requirements.txt
11
 
12
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
- COPY --chown=user . /app
15
 
16
- RUN apt-get update && \
17
- apt-get install -y gcc python3-dev gnupg curl
 
 
 
 
 
 
 
18
 
19
- RUN pip install cython
20
- RUN pip install onnxruntime==1.20.1
21
 
22
- RUN cd /app/restful/cutils && \
23
- python setup.py build_ext --inplace && \
24
- chmod 777 * && cd ../..
25
 
26
- # RUN pip install gdown
 
 
27
 
28
- # RUN --mount=type=secret,id=MODELS_ID,mode=0444,required=true \
29
- # gdown https://drive.google.com/uc?id=$(cat /run/secrets/MODELS_ID) && \
30
- # unzip models.zip && rm models.zip
31
 
32
- # RUN --mount=type=secret,id=PICKLES_ID,mode=0444,required=true \
33
- # gdown https://drive.google.com/uc?id=$(cat /run/secrets/PICKLES_ID) && \
34
- # unzip pickles.zip && rm pickles.zip
35
 
36
- # RUN --mount=type=secret,id=DATASETS_ID,mode=0444,required=true \
37
- # gdown https://drive.google.com/uc?id=$(cat /run/secrets/DATASETS_ID) && \
38
- # unzip datasets.zip && rm datasets.zip
 
 
 
 
 
 
39
 
40
- # RUN --mount=type=secret,id=POSTTRAINED_ID,mode=0444,required=true \
41
- # gdown https://drive.google.com/uc?id=$(cat /run/secrets/POSTTRAINED_ID) && \
42
- # unzip posttrained.zip && rm posttrained.zip
 
43
 
44
- # RUN git lfs install
45
- # RUN git clone https://huggingface.co/datasets/qywok/indonesia_stocks && ls && ls indonesia_stocks
46
  # RUN mkdir models && \
47
  # for i in $(seq 1 10); do \
48
  # git clone https://huggingface.co/qywok/stock_models_$i && \
 
 
 
49
  # mv stock_models_$i/*.onnx models && \
50
  # rm -rf stock_models_$i; \
51
  # done && \
52
- # ls models
 
 
 
53
 
54
- RUN apt install -y git-lfs && git lfs install
55
 
56
- RUN git clone https://huggingface.co/datasets/qywok/indonesia_stocks && \
57
- ls && ls indonesia_stocks
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
- RUN mkdir models && \
 
 
60
  for i in $(seq 1 10); do \
61
  git clone https://huggingface.co/qywok/stock_models_$i && \
62
- cd stock_models_$i && \
63
- git lfs pull && \
64
- cd .. && \
65
- mv stock_models_$i/*.onnx models && \
66
  rm -rf stock_models_$i; \
67
- done && \
68
- ls -lh models
69
 
 
70
 
71
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--workers", "5", "--port", "7860"]
 
1
+ # FROM python:3.11-bullseye
2
 
3
+ # LABEL organization="R6Q - Infraprasta University"
4
+ # LABEL team="Group 5"
5
 
6
+ # RUN useradd -m -u 1000 user
7
 
8
+ # WORKDIR /app
9
 
10
+ # COPY --chown=user ./requirements.txt requirements.txt
11
 
12
+ # RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
14
+ # COPY --chown=user . /app
15
 
16
+ # RUN apt-get update && \
17
+ # apt-get install -y gcc python3-dev gnupg curl
18
+
19
+ # RUN pip install cython
20
+ # RUN pip install onnxruntime==1.20.1
21
+
22
+ # RUN cd /app/restful/cutils && \
23
+ # python setup.py build_ext --inplace && \
24
+ # chmod 777 * && cd ../..
25
 
26
+ # # RUN pip install gdown
 
27
 
28
+ # # RUN --mount=type=secret,id=MODELS_ID,mode=0444,required=true \
29
+ # # gdown https://drive.google.com/uc?id=$(cat /run/secrets/MODELS_ID) && \
30
+ # # unzip models.zip && rm models.zip
31
 
32
+ # # RUN --mount=type=secret,id=PICKLES_ID,mode=0444,required=true \
33
+ # # gdown https://drive.google.com/uc?id=$(cat /run/secrets/PICKLES_ID) && \
34
+ # # unzip pickles.zip && rm pickles.zip
35
 
36
+ # # RUN --mount=type=secret,id=DATASETS_ID,mode=0444,required=true \
37
+ # # gdown https://drive.google.com/uc?id=$(cat /run/secrets/DATASETS_ID) && \
38
+ # # unzip datasets.zip && rm datasets.zip
39
 
40
+ # # RUN --mount=type=secret,id=POSTTRAINED_ID,mode=0444,required=true \
41
+ # # gdown https://drive.google.com/uc?id=$(cat /run/secrets/POSTTRAINED_ID) && \
42
+ # # unzip posttrained.zip && rm posttrained.zip
43
 
44
+ # # RUN git lfs install
45
+ # # RUN git clone https://huggingface.co/datasets/qywok/indonesia_stocks && ls && ls indonesia_stocks
46
+ # # RUN mkdir models && \
47
+ # # for i in $(seq 1 10); do \
48
+ # # git clone https://huggingface.co/qywok/stock_models_$i && \
49
+ # # mv stock_models_$i/*.onnx models && \
50
+ # # rm -rf stock_models_$i; \
51
+ # # done && \
52
+ # # ls models
53
 
54
+ # RUN apt install -y git-lfs && git lfs install
55
+
56
+ # RUN git clone https://huggingface.co/datasets/qywok/indonesia_stocks && \
57
+ # ls && ls indonesia_stocks
58
 
 
 
59
  # RUN mkdir models && \
60
  # for i in $(seq 1 10); do \
61
  # git clone https://huggingface.co/qywok/stock_models_$i && \
62
+ # cd stock_models_$i && \
63
+ # git lfs pull && \
64
+ # cd .. && \
65
  # mv stock_models_$i/*.onnx models && \
66
  # rm -rf stock_models_$i; \
67
  # done && \
68
+ # ls -lh models
69
+
70
+
71
+ # CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--workers", "5", "--port", "7860"]
72
 
 
73
 
74
+ FROM python:3.11-bullseye
75
+
76
+ LABEL organization="R6Q - Infraprasta University"
77
+ LABEL team="Group 5"
78
+
79
+ RUN useradd -m -u 1000 user
80
+
81
+ WORKDIR /app
82
+
83
+ COPY --chown=user ./requirements.txt requirements.txt
84
+ RUN apt-get update && \
85
+ apt-get install -y gcc python3-dev git git-lfs curl && \
86
+ pip install --no-cache-dir --upgrade -r requirements.txt && \
87
+ pip install cython onnxruntime==1.20.1
88
+
89
+ COPY --chown=user . /app
90
 
91
+ RUN git lfs install && \
92
+ git clone https://huggingface.co/datasets/qywok/indonesia_stocks && \
93
+ mkdir -p models && \
94
  for i in $(seq 1 10); do \
95
  git clone https://huggingface.co/qywok/stock_models_$i && \
96
+ cd stock_models_$i && git lfs pull && cd .. && \
97
+ mv stock_models_$i/*.onnx models/ && \
 
 
98
  rm -rf stock_models_$i; \
99
+ done
 
100
 
101
+ RUN chmod -R 755 /app
102
 
103
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]