提交 cbe0c282 编写于 作者: L llitfkitfk

update: docker build

上级 5e2ff73e
...@@ -8,19 +8,7 @@ WORKDIR /app ...@@ -8,19 +8,7 @@ WORKDIR /app
# RUN go mod download # RUN go mod download
COPY . . COPY . .
ENV GOPROXY=https://mod.gokit.info RUN ./control build
RUN echo "build monapi" \
&& go build -v -o ./bin/monapi src/modules/monapi/monapi.go \
&& echo "build transfer" \
&& go build -v -o ./bin/transfer src/modules/transfer/transfer.go \
&& echo "build tsdb" \
&& go build -v -o ./bin/tsdb src/modules/tsdb/tsdb.go \
&& echo "build index" \
&& go build -v -o ./bin/index src/modules/index/index.go \
&& echo "build judge" \
&& go build -v -o ./bin/judge src/modules/judge/judge.go \
&& echo "build collector" \
&& go build -v -o ./bin/collector src/modules/collector/collector.go
FROM alpine:3.10 FROM alpine:3.10
LABEL maintainer="llitfkitfk@gmail.com" LABEL maintainer="llitfkitfk@gmail.com"
...@@ -28,7 +16,7 @@ RUN apk add --no-cache tzdata ca-certificates bash ...@@ -28,7 +16,7 @@ RUN apk add --no-cache tzdata ca-certificates bash
WORKDIR /app WORKDIR /app
COPY --from=builder /app/etc /app/etc COPY --from=builder /app/docker/etc /app/etc
COPY --from=builder /app/bin /usr/local/bin COPY --from=builder /app/bin /usr/local/bin
......
...@@ -136,13 +136,13 @@ status() ...@@ -136,13 +136,13 @@ status()
build_one() build_one()
{ {
mod=$1 mod=$1
go build -o n9e-${mod} --tags "md5" src/modules/${mod}/${mod}.go go build -o bin/n9e-${mod} --tags "md5" src/modules/${mod}/${mod}.go
} }
build() build()
{ {
export GO111MODULE=on export GO111MODULE=on
export GOPROXY=https://mirrors.aliyun.com/goproxy/ export GOPROXY=https://mod.gokit.info
mod=$1 mod=$1
if [ "x${mod}" = "x" ]; then if [ "x${mod}" = "x" ]; then
......
...@@ -17,7 +17,7 @@ services: ...@@ -17,7 +17,7 @@ services:
monapi: monapi:
image: api image: api
restart: always restart: always
command: monapi command: n9e-monapi
volumes: volumes:
- ./docker/etc:/app/etc - ./docker/etc:/app/etc
ports: ports:
...@@ -26,7 +26,7 @@ services: ...@@ -26,7 +26,7 @@ services:
transfer: transfer:
image: api image: api
restart: always restart: always
command: transfer command: n9e-transfer
volumes: volumes:
- ./docker/etc:/app/etc - ./docker/etc:/app/etc
ports: ports:
...@@ -36,7 +36,7 @@ services: ...@@ -36,7 +36,7 @@ services:
tsdb: tsdb:
image: api image: api
restart: always restart: always
command: tsdb command: n9e-tsdb
volumes: volumes:
- ./docker/etc:/app/etc - ./docker/etc:/app/etc
ports: ports:
...@@ -46,7 +46,7 @@ services: ...@@ -46,7 +46,7 @@ services:
index: index:
image: api image: api
restart: always restart: always
command: index command: n9e-index
volumes: volumes:
- ./docker/etc:/app/etc - ./docker/etc:/app/etc
ports: ports:
...@@ -56,7 +56,7 @@ services: ...@@ -56,7 +56,7 @@ services:
judge: judge:
image: api image: api
restart: always restart: always
command: judge command: n9e-judge
volumes: volumes:
- ./docker/etc:/app/etc - ./docker/etc:/app/etc
ports: ports:
...@@ -66,7 +66,7 @@ services: ...@@ -66,7 +66,7 @@ services:
collector: collector:
image: api image: api
restart: always restart: always
command: collector command: n9e-collector
volumes: volumes:
- ./docker/etc:/app/etc - ./docker/etc:/app/etc
ports: ports:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册