1
0
Fork 0
mirror of https://github.com/anyproto/any-sync-dockercompose.git synced 2025-06-08 05:47:03 +09:00

OPS-137 add support local build docker images

This commit is contained in:
Grigory Efimov 2023-05-12 02:02:34 +03:00
parent 124541315f
commit 12ce5bb07f
8 changed files with 101 additions and 1 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
tmp/
repos/
docker-compose.override.yml

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM golang:1.19
ARG REPO_DIR=.
# git+ssh {{
RUN apt-get update && apt-get install -y ca-certificates git-core ssh rsync
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN git config --global url.ssh://git@github.com/.insteadOf https://github.com/
# }}
WORKDIR /app
# download go modules
COPY ${REPO_DIR}/go.mod ${REPO_DIR}/go.sum /
RUN --mount=type=ssh go mod download
COPY ${REPO_DIR} .
# build
RUN --mount=type=ssh make deps
RUN --mount=type=ssh make build
RUN rsync -a bin/ /bin/

View file

@ -14,7 +14,7 @@ generate_etc:
cat etc/network.yml | grep -v '^network:' > tmp/etc/any-sync-coordinator/network.yml
start: generate_etc
docker compose up --force-recreate --build --remove-orphans --detach
docker compose up --force-recreate --build --remove-orphans --detach --pull always
stop:
docker compose stop

View file

@ -56,3 +56,17 @@ use file .env
* any-sync-coordinator v0.0.10
* any-sync-filenode v0.1.5
* any-sync-node v0.0.31
## usage "local build" images
* clone repos
```
install -d repos && for REPO in any-sync-{node,filenode,coordinator}; do if [[ ! -d repos/$REPO ]]; then git clone git@github.com:anytypeio/${REPO}.git repos/$REPO; fi; done
```
* create a symlink to the "override file" you need (or you can create docker-compose.override.yml by your self)
```
ln -F -s docker-compose.any-sync-node-1.yml docker-compose.override.yml
```
* restart docker compose
```
make restart
```

View file

@ -0,0 +1,11 @@
version: "3.9"
services:
any-sync-coordinator:
image: localbuild-coordinator
build:
context: .
dockerfile: Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-coordinator/

View file

@ -0,0 +1,11 @@
version: "3.9"
services:
any-sync-filenode:
image: localbuild-filenode
build:
context: .
dockerfile: Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-filenode/

View file

@ -0,0 +1,11 @@
version: "3.9"
services:
any-sync-node-1:
image: localbuild-node
build:
context: .
dockerfile: Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-node/

View file

@ -0,0 +1,29 @@
version: "3.9"
services:
any-sync-node-1:
image: localbuild-node
build:
context: .
dockerfile: Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-node/
any-sync-node-2:
image: localbuild-node
build:
context: .
dockerfile: Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-node/
any-sync-node-3:
image: localbuild-node
build:
context: .
dockerfile: Dockerfile
ssh:
- default
args:
REPO_DIR: repos/any-sync-node/