23 أسطر
393 B
Docker
23 أسطر
393 B
Docker
# -----------------------------
|
|
# Dockerfile for Fruit API
|
|
# -----------------------------
|
|
|
|
# Use official Python image
|
|
FROM python:3.10-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the API code
|
|
COPY fruit_api.py .
|
|
|
|
# Expose port
|
|
EXPOSE 5000
|
|
|
|
# Run the API
|
|
CMD ["python", "fruit_api.py"]
|