14 Star 237 Fork 111

大巫 / chatGpt(个人微信接入)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Dockerfile 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
dawu 提交于 2022-12-10 10:14 . 提交说明
#FROM golang:1.17.10 AS builder
#
## ENV GOPROXY https://goproxy.io
#
#RUN mkdir /app
#ADD . /app/
#WORKDIR /app
#RUN go build -o wechatbot .
#
#FROM centos:centos7
#RUN mkdir /app
#WORKDIR /app
#COPY --from=builder /app/ .
#RUN chmod +x wechatbot && cp config.dev.json config.json && yum -y install vim net-tools telnet wget curl && yum clean all
#
#CMD ./wechatbot
# wechatbot/Dockerfile
# 使用 golang 官方镜像提供 Go 运行环境,并且命名为 buidler 以便后续引用
FROM golang:1.16-alpine as builder
# 启用 Go Modules 并设置 GOPROXY
ENV GO111MODULE on
ENV GOPROXY https://goproxy.cn
# 更新安装源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 安装 git
RUN apk --no-cache add git
# 设置工作目录
WORKDIR /app
# 将当前项目所在目录代码拷贝到镜像中
COPY . .
# 下载依赖
RUN go mod download
# 构建二进制文件,添加来一些额外参数以便可以在 Alpine 中运行它
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o wechatbot
# 下面是第二阶段的镜像构建,和之前保持一致
FROM alpine:latest
# 更新安装源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 安装相关软件
RUN apk update && apk add --no-cache bash supervisor ca-certificates
# 和上个阶段一样设置工作目录
RUN mkdir /app
WORKDIR /app
# 而是从上一个阶段构建的 builder容器中拉取
COPY --from=builder /app/wechatbot .
ADD supervisord.conf /etc/supervisord.conf
ADD config.dev.json /app/config.dev.json
RUN cp config.dev.json config.json
# 通过 Supervisor 管理服务
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
1
https://gitee.com/lmuiotctf/chatGpt_wechat.git
git@gitee.com:lmuiotctf/chatGpt_wechat.git
lmuiotctf
chatGpt_wechat
chatGpt(个人微信接入)
master

搜索帮助