-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 864 Bytes
/
Copy pathDockerfile
File metadata and controls
24 lines (17 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# Set the working directory in the container
WORKDIR /app
# --- NEW: Install system-level build tools ---
# This gives us the "hammers and wrenches" needed to compile some Python packages.
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*
# Copy the "shopping list" into the container
COPY requirements.txt .
# Install the libraries from the shopping list
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application's source code into the container
COPY ./src /app/src
# Tell Docker that the container will listen on port 8001
EXPOSE 8001
# Define the command to run the sensor when the container starts
CMD ["uvicorn", "src.fancell.sensors.sensor_stub:app", "--host", "0.0.0.0", "--port", "8001"]