Dockerfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Use an official Python runtime as a parent image
  2. FROM python:3.9-slim
  3. # Set the working directory in the container
  4. WORKDIR /app
  5. # Copy the current directory contents into the container at /app
  6. COPY . /app
  7. # Install required system packages
  8. RUN apt-get update && apt-get install -y --no-install-recommends \
  9. gcc \
  10. avrdude \
  11. wget \
  12. unzip \
  13. git \
  14. && rm -rf /var/lib/apt/lists/*
  15. # Install arduino-cli
  16. RUN wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_ARM64.tar.gz && \
  17. tar -xvf arduino-cli_latest_Linux_ARM64.tar.gz && \
  18. mv arduino-cli /usr/local/bin/ && \
  19. chmod +x /usr/local/bin/arduino-cli && \
  20. rm arduino-cli_latest_Linux_ARM64.tar.gz
  21. # Initialize arduino-cli and install cores
  22. RUN arduino-cli config init && \
  23. arduino-cli core update-index && \
  24. arduino-cli core install arduino:avr && \
  25. arduino-cli core install esp32:esp32
  26. # Install any needed packages specified in requirements.txt
  27. RUN pip install --no-cache-dir -r requirements.txt
  28. # Expose the port the app runs on
  29. EXPOSE 8080
  30. # Define environment variable
  31. ENV FLASK_ENV=development
  32. # Run the command to start the app
  33. CMD ["python", "app.py"]