apiVersion: apps/v1
kind: Deployment
metadata:
  name: docker-2048
spec:
  selector:
    matchLabels:
      app: docker-2048
  template:
    metadata:
      labels:
        app: docker-2048
    spec:
      containers:
      - name: docker-2048
        image: docker-2048
        env:
        # 定义容器内日志路径，logtail 为 app-demo
        - name: aliyun_logs_app-demo-sit
          value: /app/logs/*.log
        ports:
        - name: http-80
          containerPort: 80
          protocol: TCP
        lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "sleep 1"]
          preStop:
            exec:
              command:
              - "/bin/sh"
              - "-c"
              - |
                sleep 10
