|
1 | | -FROM alpine:latest AS daodao |
| 1 | +FROM alpine:latest AS postgres-data-handler |
2 | 2 |
|
3 | 3 | RUN apk update |
4 | 4 | RUN apk upgrade |
5 | | -RUN apk add --update go gcc g++ vips-dev |
| 5 | +RUN apk add --update bash go cmake g++ gcc git make vips-dev |
6 | 6 |
|
7 | 7 | WORKDIR /postgres-data-handler/src |
8 | 8 |
|
9 | 9 | COPY postgres-data-handler/go.mod postgres-data-handler/ |
10 | 10 | COPY postgres-data-handler/go.sum postgres-data-handler/ |
11 | | -COPY core/go.mod core/ |
12 | | -COPY core/go.sum core/ |
| 11 | +COPY core/go.mod core/ |
| 12 | +COPY core/go.sum core/ |
| 13 | +COPY backend/go.mod backend/ |
| 14 | +COPY backend/go.sum backend/ |
| 15 | +COPY state-consumer/go.mod state-consumer/ |
| 16 | +COPY state-consumer/go.sum state-consumer/ |
13 | 17 |
|
14 | 18 | WORKDIR /postgres-data-handler/src/postgres-data-handler |
15 | 19 |
|
16 | 20 | RUN go mod download |
17 | 21 |
|
18 | 22 | # include postgres data handler src |
19 | | -COPY postgres-data-handler/entries entries |
20 | | -COPY postgres-data-handler/migrations migrations |
| 23 | +COPY postgres-data-handler/entries entries |
| 24 | +COPY postgres-data-handler/migrations migrations |
21 | 25 | COPY postgres-data-handler/handler handler |
22 | | -COPY postgres-data-handler/main.go . |
| 26 | +COPY postgres-data-handler/main.go . |
23 | 27 |
|
24 | 28 | # include core src |
25 | | -COPY core/desohash ../core/desohash |
26 | | -COPY core/cmd ../core/cmd |
27 | | -COPY core/lib ../core/lib |
28 | | -COPY core/migrate ../core/migrate |
| 29 | +COPY core/desohash ../core/desohash |
| 30 | +COPY core/consensus ../core/consensus |
| 31 | +COPY core/collections ../core/collections |
| 32 | +COPY core/bls ../core/bls |
| 33 | +COPY core/cmd ../core/cmd |
| 34 | +COPY core/lib ../core/lib |
| 35 | +COPY core/migrate ../core/migrate |
| 36 | + |
| 37 | +# include backend src |
| 38 | +COPY backend/apis ../backend/apis |
| 39 | +COPY backend/config ../backend/config |
| 40 | +COPY backend/cmd ../backend/cmd |
| 41 | +COPY backend/miner ../backend/miner |
| 42 | +COPY backend/routes ../backend/routes |
| 43 | +COPY backend/countries ../backend/countries |
| 44 | + |
| 45 | +# include state-consumer src |
| 46 | +COPY state-consumer/consumer ../state-consumer/consumer |
29 | 47 |
|
30 | 48 | RUN go mod tidy |
31 | 49 |
|
32 | 50 | ## build postgres data handler backend |
33 | 51 | RUN GOOS=linux go build -mod=mod -a -installsuffix cgo -o bin/postgres-data-handler main.go |
34 | | -# |
35 | | -## create tiny image |
36 | | -#FROM alpine:latest |
37 | | -## |
38 | | -#RUN apk add --update vips-dev |
39 | | -## |
40 | | -#COPY --from=daodao /daodao/src/daodao-backend/bin/daodao-backend /daodao/bin/daodao-backend |
41 | | -#ENTRYPOINT ["/daodao/bin/daodao-backend"] |
| 52 | + |
42 | 53 | ENTRYPOINT ["/postgres-data-handler/src/postgres-data-handler/bin/postgres-data-handler"] |
0 commit comments