Update Dockerfile
Browse files- Dockerfile +5 -12
Dockerfile
CHANGED
|
@@ -7,19 +7,11 @@ WORKDIR /build
|
|
| 7 |
COPY go.mod go.sum ./
|
| 8 |
RUN go mod download
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
COPY . .
|
| 12 |
-
|
| 13 |
-
# 安装 unzip 工具并解压 web-user/src.zip
|
| 14 |
RUN apt-get update && apt-get install -y unzip && \
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
rm web-user/src.zip
|
| 18 |
-
|
| 19 |
-
# 解压 web-admin.zip
|
| 20 |
-
RUN mkdir -p web-admin && \
|
| 21 |
-
unzip web-admin.zip -d web-admin && \
|
| 22 |
-
rm web-admin.zip
|
| 23 |
|
| 24 |
# 构建 Go 二进制文件
|
| 25 |
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o bin/chat-api
|
|
@@ -47,3 +39,4 @@ COPY start.sh /start.sh
|
|
| 47 |
RUN chmod +x /start.sh
|
| 48 |
|
| 49 |
CMD ["/start.sh"]
|
|
|
|
|
|
| 7 |
COPY go.mod go.sum ./
|
| 8 |
RUN go mod download
|
| 9 |
|
| 10 |
+
# 复制并解压 chat-api-main.zip
|
| 11 |
+
COPY chat-api-main.zip .
|
|
|
|
|
|
|
| 12 |
RUN apt-get update && apt-get install -y unzip && \
|
| 13 |
+
unzip chat-api-main.zip && \
|
| 14 |
+
rm chat-api-main.zip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# 构建 Go 二进制文件
|
| 17 |
RUN go build -ldflags "-s -w -X 'one-api/common.Version=$(cat VERSION)' -extldflags '-static'" -o bin/chat-api
|
|
|
|
| 39 |
RUN chmod +x /start.sh
|
| 40 |
|
| 41 |
CMD ["/start.sh"]
|
| 42 |
+
|