diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f5d5a08 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM alpine:3.21 + +ENV PGHOST="database.database1.svc.cluster.local" +ENV PGDATABASE="udi-hottis" +ENV PGUSER="pv-energy-calculator" +ENV PGPASSWORD="-" +ENV PGSSLMODE="require" + +ARG USER="user" + +RUN \ + apk add --no-cache postgresql16-client && \ + addgroup $USER && \ + adduser -G $USER -D $USER + +USER $USER +WORKDIR /home/$USER + +COPY ./queries/pvec.sql . + +CMD [ "psql", "-f", "pvec.sql" ] + diff --git a/queries/pvec.sql b/queries/pvec.sql index fa851c4..a3f368f 100644 --- a/queries/pvec.sql +++ b/queries/pvec.sql @@ -51,4 +51,3 @@ INSERT INTO pv_energy_by_month update_counter = pv_energy_by_month.update_counter + 1, current_energy = (SELECT e FROM last_pv_energy_of_yesterday) - pv_energy_by_month.baseline_energy; -COMMIT;