33 lines
757 B
Docker
33 lines
757 B
Docker
# Python Simulator Dockerfile for Drone Detection System
|
|
FROM python:3.11-alpine AS base
|
|
|
|
# Install system dependencies
|
|
RUN apk add --no-cache \
|
|
curl \
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements file
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy simulator script
|
|
COPY drone_simulator.py .
|
|
|
|
# Create non-root user
|
|
RUN addgroup -g 1001 -S simulator && \
|
|
adduser -S simulator -u 1001
|
|
|
|
# Set ownership
|
|
RUN chown -R simulator:simulator /app
|
|
|
|
# Switch to non-root user
|
|
USER simulator
|
|
|
|
# Default command (can be overridden)
|
|
CMD ["python", "drone_simulator.py", "--api-url", "http://backend:3001/api", "--devices", "5", "--duration", "3600"]
|