Skip to content

Commit

Permalink
Merge pull request #197 from suyuan32/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
suyuan32 authored Oct 11, 2023
2 parents e8813a4 + ef49f61 commit 53c4ff5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Dockerfile-api
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:latest
FROM alpine:3.17

# Define the project name | 定义项目名称
ARG PROJECT=core
Expand All @@ -13,6 +13,9 @@ WORKDIR /app
ENV PROJECT=${PROJECT}
ENV CONFIG_FILE=${CONFIG_FILE}

ENV TZ=Asia/Shanghai
RUN apk update --no-cache && apk add --no-cache tzdata

COPY ./${PROJECT}_api ./
COPY ./api/etc/${CONFIG_FILE} ./etc/
COPY ./api/internal/i18n/locale/ ./etc/locale/
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile-rpc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:latest
FROM alpine:3.17

# Define the project name | 定义项目名称
ARG PROJECT=core
Expand All @@ -13,6 +13,9 @@ WORKDIR /app
ENV PROJECT=${PROJECT}
ENV CONFIG_FILE=${CONFIG_FILE}

ENV TZ=Asia/Shanghai
RUN apk update --no-cache && apk add --no-cache tzdata

COPY ./${PROJECT}_rpc ./
COPY ./rpc/etc/${CONFIG_FILE} ./etc/

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,32 +89,32 @@ gen-rpc-ent-logic: # Generate logic code from Ent, need model and group params |

.PHONY: build-win-rpc
build-win-rpc: # Build RPC project for Windows | 构建Windows下的RPC可执行文件
env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)-rpc.exe ./rpc/$(SERVICE_STYLE).go
env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc.exe ./rpc/$(SERVICE_STYLE).go
@echo "Build RPC project for Windows successfully"

.PHONY: build-mac-rpc
build-mac-rpc: # Build RPC project for MacOS | 构建MacOS下的RPC可执行文件
env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)-rpc ./rpc/$(SERVICE_STYLE).go
env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc ./rpc/$(SERVICE_STYLE).go
@echo "Build RPC project for MacOS successfully"

.PHONY: build-linux-rpc
build-linux-rpc: # Build RPC project for Linux | 构建Linux下的RPC可执行文件
env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)-rpc ./rpc/$(SERVICE_STYLE).go
env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_rpc ./rpc/$(SERVICE_STYLE).go
@echo "Build RPC project for Linux successfully"

.PHONY: build-win-api
build-win-api: # Build API project for Windows | 构建Windows下的API可执行文件
env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)-api.exe ./api/$(SERVICE_STYLE).go
env CGO_ENABLED=0 GOOS=windows GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api.exe ./api/$(SERVICE_STYLE).go
@echo "Build API project for windows successfully"

.PHONY: build-mac-api
build-mac-api: # Build API project for MacOS | 构建MacOS下的API可执行文件
env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)-api ./api/$(SERVICE_STYLE).go
env CGO_ENABLED=0 GOOS=darwin GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go
@echo "Build API project for MacOS successfully"

.PHONY: build-linux-api
build-linux-api: # Build API project for Linux | 构建Linux下的API可执行文件
env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)-api ./api/$(SERVICE_STYLE).go
env CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) go build -ldflags "$(LDFLAGS)" -trimpath -o $(SERVICE_STYLE)_api ./api/$(SERVICE_STYLE).go
@echo "Build API project for Linux successfully"

.PHONY: gen-swagger
Expand Down

0 comments on commit 53c4ff5

Please sign in to comment.