Spaces:
Sleeping
Sleeping
changed dockerfile
Browse files- Dockerfile +11 -11
Dockerfile
CHANGED
|
@@ -1,34 +1,34 @@
|
|
| 1 |
-
|
| 2 |
FROM python:3.9 as core
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
-
WORKDIR /app
|
| 6 |
|
| 7 |
# Copy and install core requirements
|
| 8 |
-
COPY ./core/requirements.txt ./requirements.txt
|
| 9 |
-
RUN pip install -r requirements.txt
|
| 10 |
|
| 11 |
# Copy the core files
|
| 12 |
-
COPY ./core
|
| 13 |
|
| 14 |
# Set the PYTHONPATH to include the /app directory
|
| 15 |
ENV PYTHONPATH="/app"
|
| 16 |
|
| 17 |
# Run the initialization script to load and serialize the dataset
|
| 18 |
-
RUN python initialization.py
|
| 19 |
|
| 20 |
# Second stage: Set up the API
|
| 21 |
FROM python:3.9
|
| 22 |
|
| 23 |
# Set the working directory
|
| 24 |
-
WORKDIR /app
|
| 25 |
|
| 26 |
# Copy and install API requirements
|
| 27 |
-
COPY ./api/requirements.txt ./requirements.txt
|
| 28 |
-
RUN pip install -r requirements.txt
|
| 29 |
|
| 30 |
# Copy the API files
|
| 31 |
-
COPY ./api
|
| 32 |
|
| 33 |
# Copy the serialized engine from the first stage
|
| 34 |
COPY --from=core /app/core/engine.pickle /app/api/engine.pickle
|
|
@@ -40,7 +40,7 @@ ENV PYTHONPATH="/app"
|
|
| 40 |
EXPOSE 9999
|
| 41 |
|
| 42 |
# Run the service manager
|
| 43 |
-
ENTRYPOINT ["python", "service_manager.py"]
|
| 44 |
|
| 45 |
# FROM python:3.9 as core
|
| 46 |
#
|
|
|
|
| 1 |
+
First stage: Build and load the dataset
|
| 2 |
FROM python:3.9 as core
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
# Copy and install core requirements
|
| 8 |
+
COPY ./core/requirements.txt ./core/requirements.txt
|
| 9 |
+
RUN pip install -r ./core/requirements.txt
|
| 10 |
|
| 11 |
# Copy the core files
|
| 12 |
+
COPY ./core ./core
|
| 13 |
|
| 14 |
# Set the PYTHONPATH to include the /app directory
|
| 15 |
ENV PYTHONPATH="/app"
|
| 16 |
|
| 17 |
# Run the initialization script to load and serialize the dataset
|
| 18 |
+
RUN python ./core/initialization.py
|
| 19 |
|
| 20 |
# Second stage: Set up the API
|
| 21 |
FROM python:3.9
|
| 22 |
|
| 23 |
# Set the working directory
|
| 24 |
+
WORKDIR /app
|
| 25 |
|
| 26 |
# Copy and install API requirements
|
| 27 |
+
COPY ./api/requirements.txt ./api/requirements.txt
|
| 28 |
+
RUN pip install -r ./api/requirements.txt
|
| 29 |
|
| 30 |
# Copy the API files
|
| 31 |
+
COPY ./api ./api
|
| 32 |
|
| 33 |
# Copy the serialized engine from the first stage
|
| 34 |
COPY --from=core /app/core/engine.pickle /app/api/engine.pickle
|
|
|
|
| 40 |
EXPOSE 9999
|
| 41 |
|
| 42 |
# Run the service manager
|
| 43 |
+
ENTRYPOINT ["python", "api/service_manager.py"]
|
| 44 |
|
| 45 |
# FROM python:3.9 as core
|
| 46 |
#
|