-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (46 loc) · 1.25 KB
/
docker-compose.yml
File metadata and controls
48 lines (46 loc) · 1.25 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
services:
dev:
image: golang:1.22.1-bullseye
working_dir: /app
volumes:
- .:/app
- go-cache:/go
ports:
- "8080:8080"
command: sh -c "
apt-get update && apt-get install -y sqlite3 libsqlite3-dev &&
go install github.com/cosmtrek/air@v1.49.0 &&
go install github.com/swaggo/swag/cmd/swag@latest &&
go mod download &&
go mod tidy &&
cd /app &&
swag init -g cmd/flowcontrol/main.go --parseDependency --parseInternal &&
air -c .air.toml"
environment:
- GO_ENV=development
- GOMODCACHE=/go/pkg/mod
- GOCACHE=/go/cache
- CONFIG_FILE=/app/config.json
- CGO_ENABLED=1
test:
image: golang:1.22.1-bullseye
working_dir: /app
volumes:
- .:/app
- go-cache:/go
environment:
- GO_ENV=test
- GOMODCACHE=/go/pkg/mod
- GOCACHE=/go/cache
- CGO_ENABLED=1
- PATH=/go/bin:${PATH}
command: sh -c "
apt-get update && apt-get install -y sqlite3 libsqlite3-dev make git curl &&
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest &&
go install github.com/swaggo/swag/cmd/swag@latest &&
go mod download &&
go mod tidy &&
cd /app &&
make"
volumes:
go-cache: