Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
im-pool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoyanbin
im-pool
Commits
85848add
Commit
85848add
authored
Nov 18, 2022
by
zhengxiuming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config edit
parent
eca82664
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
Dockerfile
Dockerfile
+39
-0
deploy.sh
deploy.sh
+4
-0
docekr-compose.yaml
docekr-compose.yaml
+18
-0
No files found.
Dockerfile
0 → 100644
View file @
85848add
# 声明镜像来源为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
deploy.sh
0 → 100644
View file @
85848add
#!/bin/bash
git pull
docker-compose up
--build
-d
docker image prune
-f
\ No newline at end of file
docekr-compose.yaml
0 → 100644
View file @
85848add
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment