-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
67 lines (66 loc) · 2.2 KB
/
docker-compose.test.yml
File metadata and controls
67 lines (66 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
services:
localstack-unit-test:
image: localstack/localstack:latest
platform: linux/arm64
environment:
- AWS_DEFAULT_REGION=us-east-1
- GATEWAY_LISTEN=0.0.0.0:4566
- SERVICES=s3,ssm,sts,iam,cloudwatch
- DEBUG=1
volumes:
- "./.localstack_volume:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
healthcheck:
test: 'curl --silent --fail localstack-unit-test:4566/_localstack/health | grep -E ''"s3": "(available|running)"'''
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
tests:
build:
context: .
dockerfile: Dockerfiles/Dockerfile.tests
platform: linux/arm64
env_file:
- ./shared_files/decrypted/local.env
environment:
# Set default values for Localstack to work
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-foobar}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-foobar}
- AWS_DEFAULT_REGION=us-east-1
- AWS_ENDPOINT_URL=http://localstack-unit-test:4566
- BFD_S3_ENDPOINT=${BFD_S3_ENDPOINT:-http://localstack-unit-test:4566}
- ENV=local
- DATABASE_URL=postgresql://postgres:toor@db-unit-test:5432/bcda_test?sslmode=disable
- GOLANGCI_LINT_CACHE=/root/.cache/go-build
- TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal
# Remaining environment variables defined in ./shared_files/decrypted/local.env
volumes:
- ./test_results:/go/src/github.com/CMSgov/bcda-app/test_results
- "/var/run/docker.sock:/var/run/docker.sock"
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
db-unit-test:
condition: service_started
localstack-unit-test:
condition: service_healthy
db-unit-test:
image: postgres:16
environment:
- POSTGRES_PASSWORD=toor
- POSTGRES_DB=bcda_test
ports:
- "15432:5432"
volumes:
- ./db/testing/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/
# Pass a flag so we'll log all queries executed on the test db.
command: ["postgres", "-c", "log_statement=all"]
postman_test:
build:
context: .
dockerfile: Dockerfiles/Dockerfile.postman_test
networks:
default:
name: bcda-app-net