diff --git a/Dockerfile b/Dockerfile index 54fc5a5..d87c404 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ FROM ubuntu:jammy-20231004 MAINTAINER bamanker -ARG NATIVE_FILE -ENV NATIVE_FILE=${NATIVE_FILE} -COPY target/${NATIVE_FILE} /home/${NATIVE_FILE}/app +COPY target/dailylove /home/dailylove/app EXPOSE 13145 -WORKDIR /home/${NATIVE_FILE}/out -ENTRYPOINT /home/${NATIVE_FILE}/app -XX:StartFlightRecording='filename=recording.jfr,dumponexit=true,duration=10s' \ No newline at end of file +WORKDIR /home/dailylove/out +ENTRYPOINT /home/dailylove/app -XX:StartFlightRecording='filename=recording.jfr,dumponexit=true,duration=10s' \ No newline at end of file diff --git a/deploy.yaml b/deploy.yaml index 202cbdf..81f38a9 100644 --- a/deploy.yaml +++ b/deploy.yaml @@ -2,15 +2,16 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: dailylove - name: dailylove + app: $APP_NAME + version: $TAG + name: $APP_NAME namespace: my-proj #一定要写名称空间 spec: progressDeadlineSeconds: 600 replicas: 1 selector: matchLabels: - app: dailylove + app: $APP_NAME strategy: rollingUpdate: maxSurge: 50% @@ -19,7 +20,8 @@ spec: template: metadata: labels: - app: dailylove + app: $APP_NAME + version: $TAG spec: imagePullSecrets: - name: aliyun-docker-hub #提前在项目下配置访问阿里云的账号密码 @@ -27,7 +29,7 @@ spec: - image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG readinessProbe: httpGet: - path: / + path: /actuator/health port: 8080 timeoutSeconds: 10 failureThreshold: 30 @@ -51,8 +53,8 @@ apiVersion: v1 kind: Service metadata: labels: - app: dailylove - name: dailylove + app: $APP_NAME + name: $APP_NAME namespace: my-proj spec: ports: @@ -61,14 +63,14 @@ spec: protocol: TCP targetPort: 13146 selector: - app: dailylove + app: $APP_NAME sessionAffinity: None type: ClusterIP --- apiVersion: v1 kind: ServiceAccount metadata: - name: dailylove # ServiceAccount的名字 + name: $APP_NAME # ServiceAccount的名字 namespace: my-proj # serviceaccount的namespace labels: - app: dailylove #ServiceAccount的标签 + app: $APP_NAME #ServiceAccount的标签