Dockerfile added

This commit is contained in:
Wolfgang Hottgenroth 2025-01-24 13:39:17 +01:00
parent ec6fc95b91
commit 4f648f1666
2 changed files with 22 additions and 1 deletions

22
Dockerfile Normal file
View File

@ -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" ]

View File

@ -51,4 +51,3 @@ INSERT INTO pv_energy_by_month
update_counter = pv_energy_by_month.update_counter + 1, 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; current_energy = (SELECT e FROM last_pv_energy_of_yesterday) - pv_energy_by_month.baseline_energy;
COMMIT;