update: docker build
This commit is contained in:
parent
5e2ff73e24
commit
cbe0c28278
16
Dockerfile
16
Dockerfile
|
@ -8,19 +8,7 @@ WORKDIR /app
|
|||
# RUN go mod download
|
||||
|
||||
COPY . .
|
||||
ENV GOPROXY=https://mod.gokit.info
|
||||
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
|
||||
RUN ./control build
|
||||
|
||||
FROM alpine:3.10
|
||||
LABEL maintainer="llitfkitfk@gmail.com"
|
||||
|
@ -28,7 +16,7 @@ RUN apk add --no-cache tzdata ca-certificates bash
|
|||
|
||||
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
|
||||
|
||||
|
||||
|
|
4
control
4
control
|
@ -136,13 +136,13 @@ status()
|
|||
build_one()
|
||||
{
|
||||
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()
|
||||
{
|
||||
export GO111MODULE=on
|
||||
export GOPROXY=https://mirrors.aliyun.com/goproxy/
|
||||
export GOPROXY=https://mod.gokit.info
|
||||
|
||||
mod=$1
|
||||
if [ "x${mod}" = "x" ]; then
|
||||
|
|
|
@ -17,7 +17,7 @@ services:
|
|||
monapi:
|
||||
image: api
|
||||
restart: always
|
||||
command: monapi
|
||||
command: n9e-monapi
|
||||
volumes:
|
||||
- ./docker/etc:/app/etc
|
||||
ports:
|
||||
|
@ -26,7 +26,7 @@ services:
|
|||
transfer:
|
||||
image: api
|
||||
restart: always
|
||||
command: transfer
|
||||
command: n9e-transfer
|
||||
volumes:
|
||||
- ./docker/etc:/app/etc
|
||||
ports:
|
||||
|
@ -36,7 +36,7 @@ services:
|
|||
tsdb:
|
||||
image: api
|
||||
restart: always
|
||||
command: tsdb
|
||||
command: n9e-tsdb
|
||||
volumes:
|
||||
- ./docker/etc:/app/etc
|
||||
ports:
|
||||
|
@ -46,7 +46,7 @@ services:
|
|||
index:
|
||||
image: api
|
||||
restart: always
|
||||
command: index
|
||||
command: n9e-index
|
||||
volumes:
|
||||
- ./docker/etc:/app/etc
|
||||
ports:
|
||||
|
@ -56,7 +56,7 @@ services:
|
|||
judge:
|
||||
image: api
|
||||
restart: always
|
||||
command: judge
|
||||
command: n9e-judge
|
||||
volumes:
|
||||
- ./docker/etc:/app/etc
|
||||
ports:
|
||||
|
@ -66,7 +66,7 @@ services:
|
|||
collector:
|
||||
image: api
|
||||
restart: always
|
||||
command: collector
|
||||
command: n9e-collector
|
||||
volumes:
|
||||
- ./docker/etc:/app/etc
|
||||
ports:
|
||||
|
|
Loading…
Reference in New Issue