Skip to content

Commit

Permalink
Cleanup docker-compose files and add descriptions (#156)
Browse files Browse the repository at this point in the history
Co-authored-by: Hackerwins <[email protected]>
  • Loading branch information
dc7303 and hackerwins authored Mar 3, 2021
1 parent 2a36c07 commit b24df02
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: make build

- name: Stack
run: docker-compose -f docker/docker-compose-cluster-mode.yml up --build -d
run: docker-compose -f docker/docker-compose-ci.yml up --build -d

- name: Test
run: go test -tags integration,stress -race -coverprofile=coverage.txt -covermode=atomic -v ./...
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ $ bin/yorkie
Tests can be run by typing `make test`.

*NOTE: `make test` includes integration tests that require local applications
such as MongoDB, etcd and Prometheus. To start them, type `docker-compose -f
docker/docker-compose-cluster-mode.yml up`.*
such as MongoDB, etcd. To start them, type `docker-compose -f
docker/docker-compose-ci.yml up --build -d`.*

If you make any changes to the code, run `make fmt` in order to automatically format the code according to Go [standards](https://golang.org/doc/effective_go.html#formatting).

Expand Down
24 changes: 24 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Docker Compose Files

[Docker Compose](https://docs.docker.com/compose/) is a tool for defining and
running multi-container Docker applications. We use Docker Compose to run the
applications needed during Yorkie development.

When developing Yorkie, we can easily run the required dependant applications
through `docker-compose` command.

```bash
# Run docker-compose up and Compose starts and runs apps.
docker-compose -f docker/docker-compose.yml up --build -d

# Shut down the apps
docker-compose -f docker/docker-compose.yml down
```

The docker-compose files we use are as follows:
- `docker-compose.yml`: This file is used to run Yorkie in standalone mode. It
only runs MongoDB, which is used to store Yorkie data.
- `docker-compose-ci.yml`: This file is used to run Yorkie's integration tests. It
runs MongoDB and etcd.
- `docker-compose-full.yml`: This file launches all the applications needed to
develop Yorkie. It also runs monitoring tools such as Prometheus and Grafana.
18 changes: 18 additions & 0 deletions docker/docker-compose-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.3'

services:
etcd:
image: bitnami/etcd:latest
container_name: etcd
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
ports:
- 2379:2379
- 2380:2380
mongo:
image: mongo:latest
container_name: mongo
restart: always
ports:
- 27017:27017
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ services:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
grafana:
image: grafana/grafana:5.1.0
container_name: grafana
ports:
- 3000:3000
depends_on:
- prometheus
etcd:
image: bitnami/etcd:latest
container_name: etcd
Expand Down

0 comments on commit b24df02

Please sign in to comment.