Dreipfelt commited on
Commit
a76d149
·
1 Parent(s): b08cdfa

add Dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +42 -4
  2. requirements.txt +10 -73
Dockerfile CHANGED
@@ -1,7 +1,45 @@
1
- FROM python:3.9-alpine
 
2
 
3
- COPY . /app/
 
 
4
 
5
- RUN echo "Cookies and cheesecakes are my favorites" > favorites_cakes.txt
 
 
 
6
 
7
- CMD python /app/app.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Build from a LINUX lightweight version of Anaconda
2
+ FROM continuumio/miniconda3
3
 
4
+ # Update packages and install nano unzip and curl
5
+ RUN apt-get update
6
+ RUN apt-get install nano unzip curl -y
7
 
8
+ # Install AWS cli - Necessary since we are going to interact with S3
9
+ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
10
+ RUN unzip awscliv2.zip
11
+ RUN ./aws/install
12
 
13
+ # THIS IS SPECIFIC TO HUGGINFACE
14
+ # We create a new user named "user" with ID of 1000
15
+ RUN useradd -m -u 1000 user
16
+ # We switch from "root" (default user when creating an image) to "user"
17
+ USER user
18
+ # We set two environmnet variables
19
+ # so that we can give ownership to all files in there afterwards
20
+ # we also add /home/user/.local/bin in the $PATH environment variable
21
+ # PATH environment variable sets paths to look for installed binaries
22
+ # We update it so that Linux knows where to look for binaries if we were to install them with "user".
23
+ ENV HOME=/home/user \
24
+ PATH=/home/user/.local/bin:$PATH
25
+
26
+ # We set working directory to $HOME/app (<=> /home/user/app)
27
+ WORKDIR $HOME/app
28
+
29
+ # Copy all local files to /home/user/app with "user" as owner of these files
30
+ # Always use --chown=user when using HUGGINGFACE to avoid permission errors
31
+ COPY --chown=user . $HOME/app
32
+
33
+ # Copy and install dependencies
34
+ COPY requirements.txt /requirements.txt
35
+ RUN pip install -r /requirements.txt
36
+
37
+ # Launch mlflow server
38
+ # Here we chose to have $PORT as environment variable but you could have hard coded 7860
39
+ # If you are sure to push into production
40
+ # Advantage to use an env variable is that your code is more portable if you were to deploy to another
41
+ # type of server
42
+ CMD mlflow server -p $PORT \
43
+ --host 0.0.0.0 \
44
+ --backend-store-uri $BACKEND_STORE_URI \
45
+ --default-artifact-root $ARTIFACT_STORE_URI
requirements.txt CHANGED
@@ -1,73 +1,10 @@
1
- alembic==1.16.4
2
- annotated-types==0.7.0
3
- anyio==4.9.0
4
- blinker==1.9.0
5
- cachetools==5.5.2
6
- certifi==2025.7.14
7
- charset-normalizer==3.4.2
8
- click==8.2.1
9
- cloudpickle==3.1.1
10
- contourpy==1.3.2
11
- cycler==0.12.1
12
- databricks-sdk==0.58.0
13
- docker==7.1.0
14
- fastapi==0.116.1
15
- Flask==3.1.1
16
- fonttools==4.58.5
17
- gitdb==4.0.12
18
- GitPython==3.1.44
19
- google-auth==2.40.3
20
- graphene==3.4.3
21
- graphql-core==3.2.6
22
- graphql-relay==3.2.0
23
- greenlet==3.2.3
24
- gunicorn==23.0.0
25
- h11==0.16.0
26
- idna==3.10
27
- importlib_metadata==8.7.0
28
- itsdangerous==2.2.0
29
- Jinja2==3.1.6
30
- joblib==1.5.1
31
- kiwisolver==1.4.8
32
- Mako==1.3.10
33
- MarkupSafe==3.0.2
34
- matplotlib==3.10.3
35
- mlflow==3.1.1
36
- mlflow-skinny==3.1.1
37
- narwhals==1.47.0
38
- numpy==2.3.1
39
- opentelemetry-api==1.35.0
40
- opentelemetry-sdk==1.35.0
41
- opentelemetry-semantic-conventions==0.56b0
42
- packaging==25.0
43
- pandas==2.3.1
44
- pillow==11.3.0
45
- plotly==6.2.0
46
- protobuf==6.31.1
47
- pyarrow==20.0.0
48
- pyasn1==0.6.1
49
- pyasn1_modules==0.4.2
50
- pydantic==2.11.7
51
- pydantic_core==2.33.2
52
- pyparsing==3.2.3
53
- python-dateutil==2.9.0.post0
54
- pytz==2025.2
55
- PyYAML==6.0.2
56
- requests==2.32.4
57
- rsa==4.9.1
58
- scikit-learn==1.7.0
59
- scipy==1.16.0
60
- six==1.17.0
61
- smmap==5.0.2
62
- sniffio==1.3.1
63
- SQLAlchemy==2.0.41
64
- sqlparse==0.5.3
65
- starlette==0.47.1
66
- threadpoolctl==3.6.0
67
- typing-inspection==0.4.1
68
- typing_extensions==4.14.1
69
- tzdata==2025.2
70
- urllib3==2.5.0
71
- uvicorn==0.35.0
72
- Werkzeug==3.1.3
73
- zipp==3.23.0
 
1
+ boto3
2
+ pandas
3
+ gunicorn
4
+ streamlit
5
+ scikit-learn
6
+ matplotlib
7
+ seaborn
8
+ plotly
9
+ mlflow
10
+ psycopg2-binary