File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 1
- FROM iron/go
1
+ FROM golang as builder
2
+
3
+ ENV GO111MODULE=on
2
4
3
5
WORKDIR /app
4
6
5
- ADD letsgo /app/
7
+ COPY go.mod .
8
+ COPY go.sum .
9
+
10
+ RUN go mod download
11
+
12
+ COPY . .
13
+
14
+ RUN CGO_ENABLED=0 GODS=linux GOARCH=amd64 go build
15
+
16
+ FROM ubuntu
17
+
18
+ COPY --from=builder /app/letsgo /app/
19
+ COPY --from=builder /app/.env /app/
20
+
21
+ RUN mkdir /app/log
6
22
7
- ENTRYPOINT ["./letsgo" ]
23
+ EXPOSE 8080
24
+ ENTRYPOINT ["/app/letsgo" ]
Original file line number Diff line number Diff line change 2
2
[ ![ Build Status] ( https://travis-ci.org/letsgo-framework/letsgo.svg?branch=master )] ( https://travis-ci.org/letsgo-framework/letsgo )
3
3
[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/letsgo-framework/letsgo )] ( https://goreportcard.com/report/github.com/letsgo-framework/letsgo )
4
4
[ ![ Coverage Status] ( https://coveralls.io/repos/github/letsgo-framework/letsgo/badge.svg?branch=master )] ( https://coveralls.io/github/letsgo-framework/letsgo?branch=master )
5
+ [ ![ Sourcegraph] ( https://sourcegraph.com/github.com/letsgo-framework/letsgo/-/badge.svg )] ( https://sourcegraph.com/github.com/letsgo-framework/letsgo?badge )
5
6
[ ![ Join the chat at https://gitter.im/letsgo-framework/community ] ( https://badges.gitter.im/Join%20Chat.svg )] ( https://gitter.im/letsgo-framework/community )
6
7
7
8
## Go api starter
Original file line number Diff line number Diff line change
1
+ version : " 2"
2
+ services :
3
+ app :
4
+ container_name : letsgo
5
+ restart : always
6
+ build : .
7
+ ports :
8
+ - " 8080:8080"
9
+ links :
10
+ - mongo
11
+ mongo :
12
+ container_name : mongo
13
+ image : mongo
14
+ volumes :
15
+ - /var/mongo/data:/data/db
16
+ ports :
17
+ - " 27017:27017"
You can’t perform that action at this time.
0 commit comments