Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.14.11 as builder

RUN apt-get update && apt-get install -y mariadb-client

WORKDIR /replicator
COPY go.mod go.sum ./

RUN go mod download

COPY . ./
RUN make build


FROM golang:1.14.11

WORKDIR /usr/bin
COPY --from=builder /replicator/bin/mysql-tarantool-replicator ./
COPY --from=builder /usr/bin/mysqldump /usr/bin/mysqldump

RUN chmod +x ./mysql-tarantool-replicator
COPY config/replicator.conf.yml /etc/mysql-tarantool/conf.yml

ENTRYPOINT ["/usr/bin/mysql-tarantool-replicator"]
CMD ["-config", "/etc/mysql-tarantool/conf.yml"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ Replicator reads primary keys from MySQL table info and sync them automatically.
Updating primary key in MySQL causes two Tarantool requests: delete an old row and insert a new one, because
it is illegal to update primary key in Tarantool.

## Docker image

How to build:

```bash
docker build -t mysql-tarantool-replicator:latest .
```

How to use:

```bash
docker run -it --rm -v /my/custom/conf.yml:/etc/mysql-tarantool/conf.yml mysql-tarantool-replicator
```

## Metrics

Replicator exposes several debug endpoints:
Expand Down