forked from iotaledger/wasp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (42 loc) · 1.26 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Build stage
FROM golang:1.16.5-buster AS build
ARG BUILD_TAGS=rocksdb
RUN mkdir /wasp
WORKDIR /wasp
# Make sure that modules only get pulled when the module file has changed
COPY go.mod go.sum /wasp/
RUN go mod download
RUN go mod verify
# Project build stage
COPY . .
RUN go build -tags="$BUILD_TAGS"
RUN go build -tags="$BUILD_TAGS" ./tools/wasp-cli
# Testing stages
# Complete testing
FROM golang:1.16.5-buster AS test-full
WORKDIR /run
COPY --from=build $GOPATH/pkg/mod $GOPATH/pkg/mod
COPY --from=build /wasp/ /run
CMD go test -tags rocksdb -timeout 20m ./...
# Unit tests without integration tests
FROM golang:1.16.5-buster AS test-unit
WORKDIR /run
COPY --from=build $GOPATH/pkg/mod $GOPATH/pkg/mod
COPY --from=build /wasp/ /run
CMD go test -tags rocksdb -short ./...
# Wasp CLI build
FROM golang:1.16.5-buster as wasp-cli
COPY --from=build /wasp/wasp-cli /usr/bin/wasp-cli
ENTRYPOINT ["wasp-cli"]
# Wasp build
FROM golang:1.16.5-buster
WORKDIR /run
EXPOSE 7000/tcp
EXPOSE 9090/tcp
EXPOSE 5550/tcp
EXPOSE 4000/udp
# Config is overridable via volume mount to /run/config.json
COPY docker_config.json /run/config.json
COPY --from=build /wasp/wasp /usr/bin/wasp
COPY --from=build /wasp/wasp-cli /usr/bin/wasp-cli
ENTRYPOINT ["wasp", "-c", "/run/config.json"]