forked from vk2him/Enphase-Envoy-mqtt-json
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 709 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (24 loc) · 709 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
25
26
27
28
29
30
# Use the official Python image as the base image
FROM python:3.9-alpine
# Set environment variables to prevent Python from writing .pyc files and buffering stdout/stderr
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Install necessary packages and dependencies
RUN apk add --no-cache \
bash \
gcc \
musl-dev \
libffi-dev \
openssl-dev
# Install required Python libraries
RUN pip install --no-cache-dir \
paho-mqtt \
requests \
urllib3
# Copy application scripts into the container
COPY run.sh /
COPY envoy_to_mqtt.py /
# Ensure the main script has execute permissions
RUN chmod +x /run.sh
# Specify the command to run when the container starts
CMD ["/run.sh"]