-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (28 loc) · 1.06 KB
/
Dockerfile
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
FROM golang
RUN mkdir -p /go/src/github.com/wednesday-solutions/go-template-consumer
RUN mkdir -p /go/src/github.com/wednesday-solutions/libs
RUN mkdir -p /go/src/github.com/wednesday-solutions/utils
RUN [ "go", "install", "github.com/rubenv/sql-migrate/...@latest"]
RUN [ "go", "install", "github.com/volatiletech/[email protected]"]
RUN [ "go", "install", "github.com/99designs/[email protected]"]
ADD ./libs /go/src/github.com/wednesday-solutions/libs
ADD ./utils /go/src/github.com/wednesday-solutions/utils
ADD ./consumer /go/src/github.com/wednesday-solutions/go-template-consumer
WORKDIR /go/src/github.com/wednesday-solutions/libs
RUN GOARCH=amd64 \
GOOS=linux \
CGO_ENABLED=0 \
go mod tidy && go mod vendor
WORKDIR /go/src/github.com/wednesday-solutions/utils
RUN GOARCH=amd64 \
GOOS=linux \
CGO_ENABLED=0 \
go mod tidy && go mod vendor
WORKDIR ../go-template-consumer
RUN GOARCH=amd64 \
GOOS=linux \
CGO_ENABLED=0 \
go mod tidy && go mod vendor
RUN go build -o ./ ./cmd/server/main.go
CMD ["bash", "./migrate-and-run.sh"]
EXPOSE 9000