price
Browse files- Dockerfile +31 -0
- requirements.txt +15 -0
Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM continuumio/miniconda3
|
| 2 |
+
|
| 3 |
+
# Update packages and install nano and curl
|
| 4 |
+
RUN apt-get update -y
|
| 5 |
+
RUN apt-get install nano curl -y
|
| 6 |
+
|
| 7 |
+
# THIS IS SPECIFIC TO HUGGINFACE
|
| 8 |
+
# We create a new user named "user" with ID of 1000
|
| 9 |
+
RUN useradd -m -u 1000 user
|
| 10 |
+
# We switch from "root" (default user when creating an image) to "user"
|
| 11 |
+
USER user
|
| 12 |
+
# We set two environmnet variables
|
| 13 |
+
# so that we can give ownership to all files in there afterwards
|
| 14 |
+
# we also add /home/user/.local/bin in the $PATH environment variable
|
| 15 |
+
# PATH environment variable sets paths to look for installed binaries
|
| 16 |
+
# We update it so that Linux knows where to look for binaries if we were to install them with "user".
|
| 17 |
+
ENV HOME=/home/user \
|
| 18 |
+
PATH=/home/user/.local/bin:$PATH
|
| 19 |
+
|
| 20 |
+
# We set working directory to $HOME/app (<=> /home/user/app)
|
| 21 |
+
WORKDIR $HOME/app
|
| 22 |
+
|
| 23 |
+
# Copy all local files to /home/user/app with "user" as owner of these files
|
| 24 |
+
# Always use --chown=user when using HUGGINGFACE to avoid permission errors
|
| 25 |
+
COPY --chown=user . $HOME/app
|
| 26 |
+
|
| 27 |
+
# Install all dependencies
|
| 28 |
+
RUN pip install -r requirements.txt
|
| 29 |
+
|
| 30 |
+
# Run FastAPI
|
| 31 |
+
CMD fastapi run app.py --port $PORT
|
requirements.txt
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi[standard]
|
| 2 |
+
pydantic
|
| 3 |
+
typing
|
| 4 |
+
pandas
|
| 5 |
+
openpyxl
|
| 6 |
+
mlflow
|
| 7 |
+
boto3
|
| 8 |
+
scikit-learn
|
| 9 |
+
python-multipart
|
| 10 |
+
fsspec
|
| 11 |
+
s3fs
|
| 12 |
+
streamlit
|
| 13 |
+
matplotlib
|
| 14 |
+
seaborn
|
| 15 |
+
plotly
|