Skip to content

Commit

Permalink
Merge pull request #29 from FantasyRL/not_main
Browse files Browse the repository at this point in the history
feat:support distributed deploy and nacos-config-center
  • Loading branch information
FantasyRL authored Jun 28, 2024
2 parents eee8ff3 + 53de77d commit 42f7909
Show file tree
Hide file tree
Showing 63 changed files with 4,992 additions and 2,160 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ hz_update.sh
kitex_update.sh
/config/config.yaml
/codeql
analz.sarif
analz.sarif
cache
20 changes: 19 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM golang:1.22 AS builder
LABEL authors="fanr"

ENV TZ Asia/Shanghai
ENV CGO_ENABLED=0
RUN go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w GOOS=linux \
Expand All @@ -12,6 +13,23 @@ WORKDIR /app

ADD . /app
RUN go mod tidy
#CMD ["go run","example"]
RUN make build-all

FROM alpine
RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata

ENV TZ Asia/Shanghai
ENV service api
EXPOSE 10002
WORKDIR /app
#COPY --from=builder /app/output /app/output
COPY --from=builder /app/config /app/config
#COPY --from=builder /app/pkg /app/pkg
COPY --from=builder /app/cmd /app/cmd
#COPY --from=builder /app/kitex_gen /app/kitex_gen

#CMD ["sh","-c","./output/${service}/${service}"]
CMD ["sh","-c","sh cmd/${service}/output/bootstrap.sh"]



6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ build-all:
@for service in $(SERVICES); do \
cd ${RPC};cd $$service; \
echo "build $$service ..." && sh build.sh; \
cd ${RPC}/$$service/output/bin/ && cp -r . ${OUTPUT}/$$service; \
# cd ${RPC}/$$service/output/bin/ && cp -r . ${OUTPUT}/$$service; \
echo "done"; \
done \
done ; \
# cd ${OUTPUT}/api; \
# mv hertz_service api;

KSERVICES := user video interaction follow chat
.PHONY: kgen
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ make build-all

目录树生成:
```bash
treer -e tree.txt -i "/.idea|.git|data/"
treer -e tree.txt -i "/.idea|.git|data|codeql|(.*)?elasticsearch|(.*)?kibana/"
```

## Todo...
Expand Down
4 changes: 2 additions & 2 deletions cmd/api/biz/handler/api/chat_handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cmd/api/biz/handler/api/follow_handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions cmd/api/biz/handler/api/interaction_handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 22 additions & 6 deletions cmd/api/biz/handler/api/user_handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions cmd/api/biz/handler/api/video_handler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 42f7909

Please sign in to comment.