forked from SamBouwer/any-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
121 lines (98 loc) · 3.19 KB
/
Dockerfile
File metadata and controls
121 lines (98 loc) · 3.19 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# TODO
# * Use any-sync-tool with Dockerfile ARG's from ENV file to create any-sync-network yaml configuration files
# * Build any-sync-node
# * Build any-sync-filenode
ARG GOLANG_VER
FROM golang:$GOLANG_VER-bullseye as any-sync-coordinator
ENV any-sync-coordinator-node-address=127.0.0.1:4830
ENV mongo-connect-uri=mongodb://localhost:27017
ENV mongo-database-name=coordinator
ENV any-sync-node-address=127.0.0.1:4430
ENV any-sync-file-node-address=127.0.0.1:4730
ENV s3-endpoint=http://127.0.0.1:9000
ENV s3-region=eu-central-1
ENV s3-profile=default
ENV s3-bucket=any-sync-files
ENV redis-url=redis://127.0.0.1:6379/?dial_timeout=3&db=1&read_timeout=6s&max_retries=2
ENV is-cluster=false
MAINTAINER Sam Bouwer
# Install dependencies
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
git \
openssl \
; \
rm -rf /var/lib/apt/lists/*
ENV PATH /usr/local/go/bin:$PATH
ENV GOPATH /go
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
# Create config with any-sync-tool
WORKDIR /anytype
RUN git clone https://github.com/anyproto/any-sync-tools
WORKDIR /anytype/any-sync-tools
RUN go install ./any-sync-network
# Instead of running "any-sync-network create" in startup script, just copy the files that should be created in advance
WORKDIR /anytype
COPY coordinator.yml .
# Build any-sync-coordinator
WORKDIR /anytype
RUN git clone https://github.com/anyproto/any-sync-coordinator
WORKDIR /anytype/any-sync-coordinator
RUN make deps
RUN make build
WORKDIR /anytype/any-sync-coordinator/bin
RUN chmod +x any-sync-coordinator
# Run startup script
WORKDIR /anytype
COPY startup_coordinator.sh .
RUN chmod -R 700 ./startup_coordinator.sh
CMD ["/bin/bash","-c","./startup_coordinator.sh"]
FROM golang:$GOLANG_VER-bullseye as any-sync-node
# Build any-sync-node
WORKDIR /anytype
RUN git clone https://github.com/anyproto/any-sync-node
WORKDIR /anytype/any-sync-node
RUN make deps
RUN make build
WORKDIR /anytype/any-sync-node/bin
RUN chmod +x any-sync-node
WORKDIR /anytype
COPY sync_1.yml .
# Run startup script
WORKDIR /anytype
COPY startup_node.sh .
RUN chmod -R 700 ./startup_node.sh
CMD ["/bin/bash","-c","./startup_node.sh"]
FROM golang:$GOLANG_VER-bullseye as any-sync-filenode
# Build any-sync-filenode
WORKDIR /anytype
RUN git clone https://github.com/anyproto/any-sync-filenode
WORKDIR /anytype/any-sync-filenode
RUN make deps
RUN make build
WORKDIR /anytype/any-sync-filenode/bin
RUN chmod +x any-sync-filenode
WORKDIR /anytype
COPY file_1.yml .
# Run startup script
WORKDIR /anytype
COPY startup_filenode.sh .
RUN chmod -R 700 ./startup_filenode.sh
CMD ["/bin/bash","-c","./startup_filenode.sh"]
# Build any-heart
WORKDIR /anytype
RUN git clone https://github.com/anyproto/anytype-heart
COPY heart.yml .
WORKDIR /anytype/any-heart
RUN make install-dev-js ANY_SYNC_NETWORK=/anytype/heart.yml
RUN make build-ios ANY_SYNC_NETWORK=/anytype/heart.yml
RUN make build-android ANY_SYNC_NETWORK=/anytype/heart.yml
WORKDIR /anytype/any-heart/anytype-ts
RUN chmod +x any-heart
# Run startup script
WORKDIR /anytype
COPY startup_heart.sh .
RUN chmod -R 700 ./startup_heart.sh
CMD ["/bin/bash","-c","./startup_heart.sh"]