otto 1 year ago
parent
commit
04581463b6
  1. 6
      Dockerfile
  2. 5
      job.yaml
  3. 21
      job1.yaml

6
Dockerfile

@ -1,4 +1,4 @@
FROM golang:1.20.5 AS builder
FROM harbor.homieyy.com/base/golang:1.20.5 AS builder
#ENV CGO_ENABLED 0
#ENV GOOS linux
@ -15,7 +15,7 @@ WORKDIR /src
#RUN go env -w GONOPROXY="git.gz.internal.jumaiyx.cn/"
#RUN go env
RUN go mod tidy
RUN go
RUN go build ./cmd/main.go
FROM harbor.homieyy.com/base/alpine:3.13
@ -23,7 +23,7 @@ RUN set -eux && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk
RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /src/main /app/server
COPY --from=builder /src/main /app/main
COPY --from=builder /src/configs /app/configs
#EXPOSE 9000
ENTRYPOINT ["./main"]

5
job.yaml

@ -11,11 +11,10 @@ spec:
spec:
containers:
- name: hotspot-queue-job
image: registry.internal.jumaiyx.cn/job/room-server-clear:1
image: harbor.homieyy.com/job/dev/hotspot-queue:364ceb13bf57f7e5029bdb23d657caa188c31e59
imagePullPolicy: IfNotPresent
command:
- ./server
- ./main
env:
- name: JM_ENVIRONMENT
value: dev

21
job1.yaml

@ -0,0 +1,21 @@
apiVersion: batch/v1
kind: Job
metadata:
name: hotspot-queue-job
namespace: dev
spec:
parallelism: 1
template:
metadata:
name: hotspot-queue-job
spec:
containers:
- name: hotspot-queue-job
image: harbor.homieyy.com/job/dev/hotspot-queue:364ceb13bf57f7e5029bdb23d657caa188c31e59
command: ["main"]
env:
- name: JM_ENVIRONMENT
value: dev
restartPolicy: OnFailure
imagePullSecrets:
- name: registry-harbor
Loading…
Cancel
Save