Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:support distributed deploy and nacos-config-center #29

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading