2
0
mirror of https://github.com/VinylDNS/vinyldns synced 2025-08-22 02:02:14 +00:00
vinyldns/build/docker/docker-compose.yml
Paul Cleary 9a81d0fa06
Support building docker images locally and without SBT (#753)
Fixes #744 

Overhauls our docker release process to run releases of docker outside of SBT.  This was tested through the signing process deploying SNAPSHOT images to docker hub.

All images do a git clone to pull vinyldns, and perform the build of the container based on that git clone.

- A new `build` directory contains the things to be built, for this PR only the docker images are here.  Anticipate possibly pulling in other artifacts in the future.
- `build/docker` contains all of the docker setup
- `build/docker/test` contains a func test docker image that can be used to test any VinylDNS API instance
- `build/docker/test-bind9` contains our bind9 setup
- `build/docker/api` is a MySQL only API distribution
- `build/docker/portal` is a MySQL only Portal distribution

In addition, a few files are added to make the build easier:

- `build/start.sh` starts a given vinyldns version
- `build/stop.sh` stops the current running vinyldns setup
- `build/release.sh` this is the **MAIN** guy that performs the build.  Lots of arguments that are useful for testing.  Can provide a repository (for publishing to a docker register that is not docker hub), for building clean vs. assuming docker images.  Besides building everything, also runs func tests (smoke tests) against the docker image before completing.

Added a `README.md` for others to follow along with

To test..

1. Make sure you increase your docker machine settings to 4GB (the default of 2GB failed)
2. Go to the `build` directory
3. From there, run `./release.sh -c -t 111` to only build the docker images, this should build `0.9.4-b111`
4. Start it up, run `./start.sh -v 0.9.4-b111`
5. Login to the portal at http://localhost:9001
6. When finished, run `./stop.sh` from the build directory
*If you see an error code 137 error, you need to increase your memory*
2019-10-22 19:11:28 -04:00

78 lines
1.6 KiB
YAML

version: "3.0"
services:
mysql:
image: "mysql:5.7"
container_name: "vinyldns-mysql"
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_ROOT_HOST: '%'
logging:
driver: none
ports:
- "19002:3306"
bind9:
build:
context: ./test-bind9
args:
BRANCH: master
image: "vinyldns/test-bind9:${VINYLDNS_VERSION}"
container_name: "vinyldns-bind9"
logging:
driver: none
ports:
- "19001:53/udp"
- "19001:53"
api:
build:
context: ./api
image: "vinyldns/api:${VINYLDNS_VERSION}"
container_name: "vinyldns-api"
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_ROOT_HOST: '%'
logging:
driver: none
ports:
- "9000:9000"
volumes:
- ./api/application.conf:/opt/docker/conf/application.conf
- ./api/logback.xml:/opt/docker/conf/logback.xml
depends_on:
- mysql
ldap:
image: rroemhild/test-openldap
container_name: "vinyldns-ldap"
ports:
- "19008:389"
portal:
build:
context: ./portal
image: "vinyldns/portal:${VINYLDNS_VERSION}"
container_name: "vinyldns-portal"
environment:
MYSQL_ROOT_PASSWORD: 'pass'
MYSQL_ROOT_HOST: '%'
logging:
driver: none
ports:
- "9001:9000"
volumes:
- ./portal/application.conf:/opt/docker/conf/application.conf
depends_on:
- api
- ldap
functest:
build:
context: ./test
image: "vinyldns/test:${VINYLDNS_VERSION}"
environment:
TEST_PATTERN: "test_verify_production"
container_name: "vinyldns-functest"
depends_on:
- api