Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
add readinessProbe to web image
Browse files Browse the repository at this point in the history
Update web image to 18.04
  • Loading branch information
sdague committed Aug 15, 2018
1 parent 6a5547f commit 5903a4b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
17 changes: 10 additions & 7 deletions images/ny-power-web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
FROM ubuntu:xenial
FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV FLASK_APP /root/app.py

USER root
ENV FLASK_APP /www/app.py

RUN apt-get update && apt-get install -y python3 python3-pip && apt-get clean

Expand All @@ -14,10 +12,15 @@ RUN pip3 install -U influxdb
RUN pip3 install -U paho-mqtt
RUN rm -rf /root/.cache

COPY app.py /root/app.py
COPY templates/ /root/templates/
COPY static/ /root/static/
RUN groupadd -r www && useradd --no-log-init -r -g www www
RUN mkdir -p /www/ && chown -R www /www

COPY app.py /www/
COPY templates/ /www/templates/
COPY static/ /www/static/

EXPOSE 5000

USER www

CMD flask run --host=0.0.0.0
7 changes: 7 additions & 0 deletions ny-power/templates/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ spec:
secretKeyRef:
name: {{ template "ny-power.fullname" . }}-mqtt-pump
key: password
readinessProbe:
httpGet:
path: /
port: 5000
initialDelaySeconds: 15
timeoutSeconds: 1

---
apiVersion: v1
kind: Service
Expand Down

0 comments on commit 5903a4b

Please sign in to comment.