Spaces:
Runtime error
Runtime error
File size: 954 Bytes
fa4b361 85d2587 fa4b361 85d2587 fa4b361 85d2587 fa4b361 bda56e1 85d2587 fa4b361 85d2587 fa4b361 85d2587 fa4b361 | 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 | # Use an official Python runtime as a parent image
# Using a slim version to keep the image size smaller
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container at /app
# This is done first to leverage Docker's layer caching
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
# Using --no-cache-dir to reduce image size
# Installs packages from the standard PyPI and also looks in the PyTorch index for torch
RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
# Copy the rest of your application's code into the container
# This includes app.py, your trained model (.pth), and the scaler (.pkl)
COPY . .
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Define the command to run your app
# This command runs when the container launches
CMD ["python", "app.py"] |