fix: move generated files to a separate directory
This commit is contained in:
@ -1,9 +1,11 @@
|
|||||||
# Use an official Python runtime as a parent image
|
# Use an official Python runtime as a parent image
|
||||||
FROM python:3.9-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
# Set the working directory in the container
|
# Set the working directory in the container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN mkdir /output
|
||||||
|
|
||||||
# Copy the dependencies file to the working directory
|
# Copy the dependencies file to the working directory
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
|||||||
4
main.py
4
main.py
@ -8,8 +8,8 @@ from datetime import datetime
|
|||||||
# --- Configuration ---
|
# --- Configuration ---
|
||||||
HA_URL = os.environ.get("HA_URL")
|
HA_URL = os.environ.get("HA_URL")
|
||||||
HA_TOKEN = os.environ.get("HA_TOKEN")
|
HA_TOKEN = os.environ.get("HA_TOKEN")
|
||||||
DATA_FILE = "sensor_data.json"
|
DATA_FILE = "/output/sensor_data.json"
|
||||||
HTML_FILE = "index.html"
|
HTML_FILE = "/output/index.html"
|
||||||
TEMPLATE_DIR = "templates"
|
TEMPLATE_DIR = "templates"
|
||||||
|
|
||||||
# --- Error Handling ---
|
# --- Error Handling ---
|
||||||
|
|||||||
Reference in New Issue
Block a user