Commit 203bc34f authored by zhengxiuming's avatar zhengxiuming

部署配置文件

parent 914cecaa
FROM golang:alpine as builder
MAINTAINER lwnmengjing
ENV GOPROXY https://goproxy.cn/
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /go/release
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
......
FROM golang:alpine as builder
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /go/release
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add tzdata
COPY go.mod ./go.mod
RUN go mod tidy
COPY . .
RUN pwd && ls
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
FROM alpine
COPY --from=builder /go/release/go-admin /
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 8000
CMD ["/go-admin","server","-c", "/config/settings.yml"]
\ No newline at end of file
#!/bin/bash
git pull
docker-compose up --build -d
docker image prune -f
\ No newline at end of file
version: "3.5"
services:
nbya_back_prod:
restart: always
build:
context: .
args:
ENVARG: dev
dockerfile: PROD.Dockerfile
image: nbya_back:prod
ports:
- 8053:8053
networks:
- diagnosis_network
networks:
diagnosis_network:
driver: bridge
\ No newline at end of file
version: "3.5"
services:
nbya_back_dev:
restart: always
build:
context: .
args:
ENVARG: dev
dockerfile: Dockerfile
image: nbya_back:dev
ports:
- 8053:8053
networks:
- diagnosis_network
networks:
diagnosis_network:
driver: bridge
\ No newline at end of file
#!/bin/bash
docker-compose -f docker-compo-prod.yaml up --build -d
docker image prune -f
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment