Skip to content

Commit

Permalink
update services and docker compose version
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Nov 6, 2023
1 parent acdda3d commit e388f19
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
62 changes: 31 additions & 31 deletions TESTING_dockercompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Run the following commands to get up and running with this example.

```bash
# should remove any previous runs and poweroff
docker-compose down --volumes --remove-orphans
docker compose down --volumes --remove-orphans

# should start up our services successfully
docker-compose build && docker-compose up -d
docker compose build && docker compose up -d
```

Verification commands
Expand All @@ -23,59 +23,59 @@ Run the following commands to validate things are rolling as they should.

```bash
# Ensure services are ready to connect
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://mariadb-10-4:3306 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://mariadb-10-6:3306 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://mariadb-10-5:3306 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://mariadb-10-11:3306 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://postgres-11:5432 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://postgres-15:5432 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://opensearch-2:9200 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://mongo-4:27017 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://redis-5:6379 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://redis-6:6379 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://redis-7:6379 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://solr-7:8983 -timeout 1m
docker run --rm --net internal-services-test_default jwilder/dockerize dockerize -wait tcp://solr-8:8983 -timeout 1m

# commons should be running Alpine Linux
docker-compose exec -T commons sh -c "cat /etc/os-release" | grep "Alpine Linux"
docker compose exec -T commons sh -c "cat /etc/os-release" | grep "Alpine Linux"

# mariadb-10-4 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10.4" | grep "SERVICE_HOST=10.4"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10.4" | grep "LAGOON_TEST_VAR=internal-services-test"
# mariadb-10-5 should be able to read/write data
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-5" | grep "SERVICE_HOST=10.5"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-5" | grep "LAGOON_TEST_VAR=internal-services-test"

# mariadb-10-6 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10.6" | grep "SERVICE_HOST=10.6"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10.6" | grep "LAGOON_TEST_VAR=internal-services-test"
# mariadb-10-11 should be able to read/write data
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-11" | grep "SERVICE_HOST=10.11"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mariadb?service=mariadb-10-11" | grep "LAGOON_TEST_VAR=internal-services-test"

# postgres-11 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-11" | grep "SERVICE_HOST=PostgreSQL 11"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-11" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-11" | grep "SERVICE_HOST=PostgreSQL 11"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-11" | grep "LAGOON_TEST_VAR=internal-services-test"

# postgres-15 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-15" | grep "SERVICE_HOST=PostgreSQL 15"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-15" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-15" | grep "SERVICE_HOST=PostgreSQL 15"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/postgres?service=postgres-15" | grep "LAGOON_TEST_VAR=internal-services-test"

# opensearch-2 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/opensearch?service=opensearch-2" | grep "SERVICE_HOST=opensearch-2"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/opensearch?service=opensearch-2" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/opensearch?service=opensearch-2" | grep "SERVICE_HOST=opensearch-2"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/opensearch?service=opensearch-2" | grep "LAGOON_TEST_VAR=internal-services-test"

# mongo-4 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/mongo?service=mongo-4" | grep "SERVICE_HOST="
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/mongo?service=mongo-4" | grep "LAGOON_TEST_VAR=internal-services-test"

# redis-5 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-5" | grep "SERVICE_HOST=redis-5"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-5" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mongo?service=mongo-4" | grep "SERVICE_HOST="
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/mongo?service=mongo-4" | grep "LAGOON_TEST_VAR=internal-services-test"

# redis-6 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-6" | grep "SERVICE_HOST=redis-6"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-6" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-6" | grep "SERVICE_HOST=redis-6"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-6" | grep "LAGOON_TEST_VAR=internal-services-test"

# redis-7 should be able to read/write data
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-7" | grep "SERVICE_HOST=redis-7"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/redis?service=redis-7" | grep "LAGOON_TEST_VAR=internal-services-test"

# solr-7 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-7" | grep "SERVICE_HOST=solr-7"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-7" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-7" | grep "SERVICE_HOST=solr-7"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-7" | grep "LAGOON_TEST_VAR=internal-services-test"

# solr-8 should be able to read/write data
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-8" | grep "SERVICE_HOST=solr-8"
docker-compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-8" | grep "LAGOON_TEST_VAR=internal-services-test"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-8" | grep "SERVICE_HOST=solr-8"
docker compose exec -T commons sh -c "curl -kL http://go-web:3000/solr?service=solr-8" | grep "LAGOON_TEST_VAR=internal-services-test"
```

Destroy tests
Expand All @@ -85,5 +85,5 @@ Run the following commands to trash this app like nothing ever happened.

```bash
# should be able to destroy our services with success
docker-compose down --volumes --remove-orphans
docker compose down --volumes --remove-orphans
```
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ services:
- LAGOON_GIT_SHA=SHA256
- LAGOON_ENVIRONMENT_TYPE=development

mariadb-10-4:
image: uselagoon/mariadb-10.4:latest
mariadb-10-5:
image: uselagoon/mariadb-10.5:latest
labels:
lagoon.type: mariadb-single
ports:
- '3306'

mariadb-10-6:
image: uselagoon/mariadb-10.6:latest
mariadb-10-11:
image: uselagoon/mariadb-10.11:latest
labels:
lagoon.type: mariadb
ports:
Expand Down Expand Up @@ -78,14 +78,14 @@ services:
ports:
- '27017'

redis-5:
redis-6:
image: uselagoon/redis-5:latest
labels:
lagoon.type: redis
ports:
- '6379'

redis-6:
redis-7:
image: uselagoon/redis-6:latest
labels:
lagoon.type: redis
Expand Down

0 comments on commit e388f19

Please sign in to comment.