add Dockerfile and run.sh
parent
23ca747cb9
commit
cd5a3456ab
|
@ -0,0 +1,7 @@
|
||||||
|
FROM alpine:latest
|
||||||
|
USER root
|
||||||
|
RUN apk --no-cache add tzdata
|
||||||
|
ENV TZ=Asia/Shanghai
|
||||||
|
COPY ai-week /usr/local/bin
|
||||||
|
RUN chmod +x /usr/local/bin/ai-week
|
||||||
|
ENTRYPOINT ["ai-week"]
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#安装golang1.22.2
|
||||||
|
wget https://golang.google.cn/dl/go1.22.2.linux-amd64.tar.gz
|
||||||
|
tar -zxvf go1.22.2.linux-amd64.tar.gz -C /usr/local/
|
||||||
|
go env -w GO111MODULE=on
|
||||||
|
go env -w GOPROXY=https://goproxy.cn,direct
|
||||||
|
go version
|
||||||
|
#编译
|
||||||
|
cd ./cmd
|
||||||
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ../ai-week
|
||||||
|
#镜像
|
||||||
|
docker build -t ai-week:v2 .
|
||||||
|
sleep 3
|
||||||
|
docker run --name week -d --restart always ai-week:v2
|
Loading…
Reference in New Issue