-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathgolang.yml
More file actions
32 lines (28 loc) · 730 Bytes
/
golang.yml
File metadata and controls
32 lines (28 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
version: "3.7"
services:
golang:
environment:
GO111MODULE: "on" # 启用 go module 模式
GOPROXY: https://goproxy.cn,direct # 设置国内代理
CGO_ENABLED: 0 # 禁用 gcc
GOOS: linux
image: app/golang:alpine
container_name: micro_golang
build:
context: .
dockerfile: ./services/golang/${dockerfile}
volumes:
- ${APP_PATH}:/app:rw
- gomod:/go/pkg/mod
stdin_open: true
tty: true
restart: always
networks:
- app
volumes:
gomod:
external: false # 外部 `docker volume ls` 查看
name: app_gomod
networks:
app:
name: app # `docker network ls` 查询 && 根据实际填写