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:
parent
124541315f
commit
12ce5bb07f
8 changed files with 101 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
tmp/
|
tmp/
|
||||||
|
repos/
|
||||||
|
docker-compose.override.yml
|
||||||
|
|
22
Dockerfile
Normal file
22
Dockerfile
Normal 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/
|
2
Makefile
2
Makefile
|
@ -14,7 +14,7 @@ generate_etc:
|
||||||
cat etc/network.yml | grep -v '^network:' > tmp/etc/any-sync-coordinator/network.yml
|
cat etc/network.yml | grep -v '^network:' > tmp/etc/any-sync-coordinator/network.yml
|
||||||
|
|
||||||
start: generate_etc
|
start: generate_etc
|
||||||
docker compose up --force-recreate --build --remove-orphans --detach
|
docker compose up --force-recreate --build --remove-orphans --detach --pull always
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
docker compose stop
|
docker compose stop
|
||||||
|
|
14
README.md
14
README.md
|
@ -56,3 +56,17 @@ use file .env
|
||||||
* any-sync-coordinator v0.0.10
|
* any-sync-coordinator v0.0.10
|
||||||
* any-sync-filenode v0.1.5
|
* any-sync-filenode v0.1.5
|
||||||
* any-sync-node v0.0.31
|
* 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
|
||||||
|
```
|
||||||
|
|
11
docker-compose.any-sync-coordinator.yml
Normal file
11
docker-compose.any-sync-coordinator.yml
Normal 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/
|
11
docker-compose.any-sync-filenode.yml
Normal file
11
docker-compose.any-sync-filenode.yml
Normal 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/
|
11
docker-compose.any-sync-node-1.yml
Normal file
11
docker-compose.any-sync-node-1.yml
Normal 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/
|
29
docker-compose.any-sync-node-all.yml
Normal file
29
docker-compose.any-sync-node-all.yml
Normal 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/
|
Loading…
Add table
Add a link
Reference in a new issue