Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +35 -8
Dockerfile
CHANGED
|
@@ -1,20 +1,47 @@
|
|
| 1 |
-
# Use an official Python
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY . /app
|
| 9 |
|
| 10 |
-
# Install
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
#
|
| 14 |
EXPOSE 8000
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
CMD ["uvicorn", "
|
| 18 |
-
|
| 19 |
|
| 20 |
|
|
|
|
| 1 |
+
# Use an official Python image from Docker Hub
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
+
apt-get install -y \
|
| 10 |
+
git \
|
| 11 |
+
unzip \
|
| 12 |
+
curl \
|
| 13 |
+
xz-utils \
|
| 14 |
+
libssl-dev \
|
| 15 |
+
libreadline-dev \
|
| 16 |
+
libyaml-dev \
|
| 17 |
+
libsqlite3-dev \
|
| 18 |
+
sqlite3 \
|
| 19 |
+
libbz2-dev \
|
| 20 |
+
libgdbm-dev \
|
| 21 |
+
libncurses5-dev \
|
| 22 |
+
libncursesw5-dev \
|
| 23 |
+
libffi-dev \
|
| 24 |
+
liblzma-dev \
|
| 25 |
+
libmagic-dev \
|
| 26 |
+
make \
|
| 27 |
+
clang \
|
| 28 |
+
cmake \
|
| 29 |
+
xcode-select \
|
| 30 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 31 |
+
|
| 32 |
+
# Install Fastlane
|
| 33 |
+
RUN curl -sL https://dl.bintray.com/fastlane/fastlane/install | bash
|
| 34 |
+
|
| 35 |
+
# Copy the FastAPI app files to the container
|
| 36 |
COPY . /app
|
| 37 |
|
| 38 |
+
# Install FastAPI and Uvicorn
|
| 39 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 40 |
|
| 41 |
+
# Expose the port the app will run on
|
| 42 |
EXPOSE 8000
|
| 43 |
|
| 44 |
+
# Start the FastAPI app
|
| 45 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 46 |
|
| 47 |
|