From 73f1cc423dfaa308bab5664bf58e2f9c291963ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=99=9E=E5=87=AF=E6=9C=9D?= <38757894+yukaichao@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0docker=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f9e12260 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# 使用 Go 语言官方基础镜像 +FROM golang:latest + +# 设置工作目录 +WORKDIR /app + +# 复制所有文件到工作目录 +COPY . . + +# 初始化 Go module +RUN go mod init + +# 构建应用 +RUN go build -o easydarwin . + +# 暴露所需的端口 +EXPOSE 554 +EXPOSE 10008 + +# 启动应用 +CMD ["./easydarwin"]