Skip to content

Commit

Permalink
updating docker-compose and fixing docker-compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
arroyoAle committed Aug 1, 2024
1 parent 1f12ef4 commit 635d20f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 47 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ test:
# Builds a docker image, starts it up with a postgres container, waits for a successful response from the survey service
# /info endpoint, then runs unit tests and integration tests against the services in docker.
integration-test: docker
docker-compose -f compose-integration-tests.yml down
docker-compose -f compose-integration-tests.yml up -d
docker compose -f compose-integration-tests.yml down
docker compose -f compose-integration-tests.yml up -d
./wait_for_startup_integration_tests.sh ||\
(docker-compose -f compose-integration-tests.yml down && exit 1)
(docker compose -f compose-integration-tests.yml down && exit 1)
go test --tags=integration -race -coverprofile=coverage.txt -covermode=atomic github.com/ONSdigital/rm-survey-service/models ||\
(docker-compose -f compose-integration-tests.yml down && exit 1)
docker-compose -f compose-integration-tests.yml down
(docker compose -f compose-integration-tests.yml down && exit 1)
docker compose -f compose-integration-tests.yml down

# Remove the build directory tree.
clean:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ Once the app is running you should call the app with blank http auth values. Thi
To start Docker containers for both PostgreSQL and the Survey service, run:

```
docker-compose up -d
docker compose up -d
```

To stop and remove the two Docker containers, run:

```
docker-compose down
docker compose down
```

## Testing
Expand Down
41 changes: 21 additions & 20 deletions compose-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
database:
container_name: postgres-survey-it
image: postgres:9.6-alpine
ports:
- "15432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
services:
database:
container_name: postgres-survey-it
image: postgres:9.6-alpine
ports:
- "15432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password

survey:
container_name: surveysvc-it
image: sdcplatform/surveysvc
ports:
- "9090:8080"
links:
- database
environment:
- DATABASE_URL=postgres://postgres:password@postgres-survey-it:5432/postgres?sslmode=disable
- security_user_name=admin
- security_user_password=secret
survey:
container_name: surveysvc-it
image: sdcplatform/surveysvc
ports:
- "9090:8080"
links:
- database
environment:
- DATABASE_URL=postgres://postgres:password@postgres-survey-it:5432/postgres?sslmode=disable
- security_user_name=admin
- security_user_password=secret
41 changes: 21 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
database:
container_name: postgres
image: postgres:9.6-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
services:
database:
container_name: postgres
image: postgres:9.6-alpine
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password

survey:
container_name: surveysvc
image: eu.gcr.io/ons-rasrmbs-management/survey
ports:
- "8080:8080"
links:
- database
environment:
- DATABASE_URL=postgres://postgres:password@database/postgres?sslmode=disable
- security_user_name=admin
- security_user_password=secret
survey:
container_name: surveysvc
image: eu.gcr.io/ons-rasrmbs-management/survey
ports:
- "8080:8080"
links:
- database
environment:
- DATABASE_URL=postgres://postgres:password@database/postgres?sslmode=disable
- security_user_name=admin
- security_user_password=secret

0 comments on commit 635d20f

Please sign in to comment.