mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 02:40:23 +08:00
commit
d982172f67
@ -110,22 +110,11 @@ start:
|
||||
make port;
|
||||
|
||||
|
||||
# Build docker image.
|
||||
# Build docker image and commit to the repository.
|
||||
# example: make image tag=v0.0.1
|
||||
.PHONY: image
|
||||
image: cli.install
|
||||
$(eval _TAG = $(shell git log -1 --format="%cd.%h" --date=format:"%Y%m%d%H%M%S"))
|
||||
ifneq (, $(shell git status --porcelain 2>/dev/null))
|
||||
$(eval _TAG = $(_TAG).dirty)
|
||||
endif
|
||||
$(eval _TAG = $(if ${TAG}, ${TAG}, $(_TAG)))
|
||||
$(eval _PUSH = $(if ${PUSH}, ${PUSH}, ))
|
||||
@gf docker -p -b "-a amd64 -s linux -p temp" -t $(DOCKER_NAME):${_TAG};
|
||||
|
||||
|
||||
# Build docker image and automatically push to docker repo.
|
||||
.PHONY: image.push
|
||||
image.push:
|
||||
@make image PUSH=-p;
|
||||
image:
|
||||
@echo "y" | gf docker main.go -p -tn hotgo:$(tag)
|
||||
|
||||
|
||||
# Deploy image and yaml to current kubectl environment.
|
||||
|
@ -13,6 +13,13 @@ gfcli:
|
||||
output: "./temp/hotgo" # 可执行文件生成路径
|
||||
extra: ""
|
||||
|
||||
|
||||
docker:
|
||||
build: "-a amd64 -s linux -p temp -ew" # 构建参数
|
||||
tagPrefixes: # 该docker的标记前缀,用于docker推送,请替换成你自己的
|
||||
- ccr.ccs.tencentyun.com/bufanyun
|
||||
|
||||
|
||||
gen:
|
||||
dao:
|
||||
- link: "mysql:hotgo:hg123456.@tcp(127.0.0.1:3306)/hotgo?loc=Local&parseTime=true"
|
||||
@ -26,6 +33,7 @@ gfcli:
|
||||
gJsonSupport: true
|
||||
clear: false
|
||||
|
||||
|
||||
# service: # 生成业务配置
|
||||
# srcFolder: "internal/logic"
|
||||
# dstFolder: "internal/service"
|
||||
|
@ -5,12 +5,19 @@ FROM loads/alpine:3.8
|
||||
###############################################################################
|
||||
|
||||
ENV WORKDIR /app
|
||||
ADD resource $WORKDIR/
|
||||
ADD ./temp/linux_amd64/main $WORKDIR/main
|
||||
RUN chmod +x $WORKDIR/main
|
||||
ADD hack $WORKDIR/hack/
|
||||
ADD manifest/config $WORKDIR/manifest/config/
|
||||
ADD resource $WORKDIR/resource/
|
||||
ADD ./temp/linux_amd64/hotgo $WORKDIR/hotgo
|
||||
ADD ./manifest/docker/entrypoint.sh $WORKDIR/entrypoint.sh
|
||||
RUN chmod +x $WORKDIR/hotgo
|
||||
RUN chmod +x $WORKDIR/entrypoint.sh
|
||||
|
||||
|
||||
###############################################################################
|
||||
# START
|
||||
###############################################################################
|
||||
|
||||
WORKDIR $WORKDIR
|
||||
CMD ./main
|
||||
CMD ./entrypoint.sh
|
||||
|
||||
|
5
server/manifest/docker/entrypoint.sh
Normal file
5
server/manifest/docker/entrypoint.sh
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /app && ./hotgo &
|
||||
echo "hotgo start all server.."
|
||||
tail -f /dev/null
|
Loading…
Reference in New Issue
Block a user