File size: 1,304 Bytes
4a78624
ceff4eb
 
 
 
 
 
 
 
 
 
 
 
0d4f69b
4a78624
 
ceff4eb
 
 
0d4f69b
4a78624
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ceff4eb
0d4f69b
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.12-slim-buster

COPY h5-model /h5-model
COPY autotab /autotab
COPY data/spec_repr /data/spec_repr
COPY scripts /scripts
COPY streamlit /streamlit
COPY Makefile /Makefile
COPY MANIFEST.in /MANIFEST.in
COPY README.md /README.md
COPY Procfile /Procfile
COPY requirements.txt /requirements.txt
COPY setup.py /setup.py
COPY api/api_app.py /api/api_app.py
COPY le-wagon-737-a89ea614b8b4.json /credentials.json


RUN pip install --upgrade pip 
RUN pip install -r requirements.txt
RUN apt-get update -y && apt-get install -y --no-install-recommends build-essential gcc \

                                        libsndfile1 curl


# Downloading gcloud package
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz

# Installing the package
RUN mkdir -p /usr/local/gcloud \

  && tar -C /usr/local/gcloud -xvf /tmp/google-cloud-sdk.tar.gz \
  && /usr/local/gcloud/google-cloud-sdk/install.sh

# Adding the package path to local
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin

ENV GOOGLE_APPLICATION_CREDENTIALS /credentials.json
RUN gcloud config set project le-wagon-737
RUN gcloud auth activate-service-account --key-file=/credentials.json



CMD uvicorn api.api_app:app --host 0.0.0.0 --port $PORT