Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. && rm -rf /var/lib/apt/lists/*
  14. # Install arduino-cli
  15. RUN wget https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz && \
  16. tar -xvf arduino-cli_latest_Linux_64bit.tar.gz && \
  17. mv arduino-cli /usr/local/bin/ && \
  18. rm arduino-cli_latest_Linux_64bit.tar.gz
  19. # Initialize arduino-cli
  20. RUN arduino-cli config init && \
  21. arduino-cli core update-index && \
  22. arduino-cli core install arduino:avr
  23. # Install any needed packages specified in requirements.txt
  24. RUN pip install --no-cache-dir -r requirements.txt
  25. # Expose the port the app runs on
  26. EXPOSE 8080
  27. # Define environment variable
  28. ENV FLASK_ENV=development
  29. # Run the command to start the app
  30. CMD ["python", "app.py"]