-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
34 lines (27 loc) · 1.1 KB
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Use the specified base image
FROM dtcooper/raspberrypi-os:python
# Set the working directory in the container
WORKDIR /usr/app
# Install curl
# Download and install rust. This container uses FastAPI. Even with fastapi-slim,
# orjson is included which is dependent on rust. I don't think fastapi-slim uses it..
# but such is as it is.
# Clean up the package cache. These are the files that were downloaded during apt-get and are no longer needed.
RUN apt-get update && \
apt-get install -y curl && \
curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$HOME/.cargo/bin:$PATH" && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the requirements file and install Python dependencies
COPY requirements.txt ./
RUN . "$HOME/.cargo/env" && pip install --no-cache-dir -r requirements.txt
# Copy the source code
COPY src/ /usr/app/src
COPY mistbuddy_lite.py /usr/app/
COPY config.yaml /usr/app/
# Set environment variables for the application
ENV PYTHONPATH=/usr/app
# Expose port 8085
EXPOSE 8085
# Define the default command to run the application
CMD ["python", "/usr/app/mistbuddy_lite.py"]