Commit 85848add authored by zhengxiuming's avatar zhengxiuming

config edit

parent eca82664
# 声明镜像来源为golang:alpine
FROM golang:alpine
# 设置环境变量GO111MODULE为on
ENV GO111MODULE=on
# 设置环境变量GOPROXY为https://goproxy.io,direct
ENV GOPROXY=https://goproxy.cn,direct
# 声明工作目录
WORKDIR /go/src/im-poll
# 拷贝server项目到工作目录
COPY . .
# go env为查看go的环境变量, go build -o server . 为打包项目,二进制
RUN go env && go build -o server ws_server.go
# ======= 以下为多阶段构建 =======
# 声明镜像来源为alpine:latest
FROM alpine:latest
ENV TZ=Asia/Shanghai
RUN echo "http://mirrors.aliyun.com/alpine/v3.4/main/" > /etc/apk/repositories \
&& apk --no-cache add tzdata zeromq \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo '$TZ' > /etc/timezone
# 声明工作目录
WORKDIR /go/src/im-poll
# 拷贝打包好的server二进制文件到当前工作目录
COPY --from=0 /go/src/im-poll/server ./
# 拷贝config.yaml配置文件到当前工作目录
# COPY --from=0 /go/src/gin-vue-admin/config.yaml ./
# 运行打包好的二进制
ENTRYPOINT ./server
\ 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:
im_pool_dev:
restart: always
build:
context: .
args:
ENVARG: dev
dockerfile: Dockerfile
image: im_pool:dev
ports:
- 11001:11001
networks:
- diagnosis_network
networks:
diagnosis_network:
driver: bridge
\ 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