Sign inSign up

chj9/wechat-webhook

By chj9

•Updated about 4 years ago

Image
1

286

chj9/wechat-webhook repository overview

Dockerfile

FROM python:3.9.6
WORKDIR /src
MAINTAINER __AUTHOR__
ADD Dockerfile /src
ADD app.py /src
ADD requirements.txt /src
# install requirements
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
EXPOSE 5000
# run server
CMD python app.py

run in k8s

apiVersion: apps/v1
kind: Deployment
metadata:
  name: atai-alert-webhook
  labels:
    app: atai-alert-webhook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: atai-alert-webhook
  template:
    metadata:
      labels:
        app: atai-alert-webhook
    spec:
      volumes:
        - name: host-time
          hostPath:
            path: /etc/localtime
            type: ''
      containers:
        - name: atai-alert-webhook
          image: 'chj9/wechat-webhook:latest'
          ports:
            - name: http
              containerPort: 5000
              protocol: TCP
          resources:
            limits:
              cpu: 100m
              memory: 200Mi
            requests:
              cpu: 10m
              memory: 10Mi
          volumeMounts:
            - name: host-time
              readOnly: true
              mountPath: /etc/localtime
          env:
            - name: DEFAULT_ROBOT_TOKENS
              value: "xxxxx"
            - name: CRITICAL_ROBOT_TOKENS
              value: "xxxx"
            - name: NOTIFY_USER
              value: "xxxx"
      restartPolicy: Always
      imagePullSecrets:
        - name: s3-ware
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 2

---
kind: Service
apiVersion: v1
metadata:
  name: atai-alert-webhook
spec:
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 80
  selector:
    app: atai-alert-webhook
  type: ClusterIP
  sessionAffinity: None

Tag summary

Content type

Image

Digest

Size

351.5 MB

Last updated

about 4 years ago

docker pull chj9/wechat-webhook