-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.test.yml
84 lines (80 loc) · 2.73 KB
/
docker-compose.test.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version: "3.8"
services:
app:
build:
context: .
args:
- ENV=test
container_name: tile-cache_test
volumes:
- ./app:/app/app:ro
- ./lambdas:/app/lambdas:ro
- ./tests:/app/tests
- ./terraform:/app/terraform
- /var/run/docker.sock:/var/run/docker.sock
environment:
- DATABASE_RO=_test
- DB_USER_RO=gfw
- DB_PASSWORD_RO=postgres # pragma: allowlist secret
- DB_PORT_RO=5432
- DB_HOST_RO=test_database
- LOG_LEVEL=debug
- AWS_ACCESS_KEY_ID=testing # pragma: allowlist secret
- AWS_SECRET_ACCESS_KEY=testing # pragma: allowlist secret
- AWS_SECURITY_TOKEN=testing # pragma: allowlist secret
- AWS_SESSION_TOKEN=testing # pragma: allowlist secret
- AWS_ENDPOINT_URI=http://localstack:4566
- AWS_S3_ENDPOINT=localstack:4566
- AWS_VIRTUAL_HOSTING=False
- AWS_HTTPS=NO
- LOCALSTACK_HOSTNAME=localstack
- HTTPX_TIMEOUT=60
- RASTER_TILER_LAMBDA_NAME=test_project-lambda-tiler
- ENV=test
- BUCKET=gfw-tiles-test
- DATA_LAKE_BUCKET=gfw-data-lake-test
- PLANET_API_KEY
entrypoint: /app/tests/run_tests.sh
depends_on:
- test_database
- localstack
test_database:
container_name: gfw-tile-cache-test-database
image: postgis/postgis:12-2.5-alpine
ports:
- "54322:5432"
environment:
- POSTGRES_PORT=5432
- POSTGRES_DB=_test
- POSTGRES_USER=gfw
- POSTGRES_PASSWORD=postgres # pragma: allowlist secret
volumes:
- test_database_data:/var/lib/postgresql/data
restart: on-failure
localstack:
container_name: localstack
image: localstack/localstack-pro:2.2.0 # required for Pro
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
- "127.0.0.1:53:53" # DNS config (required for Pro)
- "127.0.0.1:53:53/udp" # DNS config (required for Pro)
- "127.0.0.1:443:443" # LocalStack HTTPS Gateway (required for Pro)
- '8055:8080'
- '${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}'
environment:
- SERVICES=iam,lambda,sts,cloudwatch,events,s3,logs
- DEBUG=1
- DISABLE_EVENTS=1
- LAMBDA_DOCKER_NETWORK=gfw-tile-cache_test_default
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN}
- LAMBDA_KEEPALIVE_MS=0
- DOCKER_HOST=unix:///var/run/docker.sock
- HOSTNAME_EXTERNAL=localstack
- HOSTNAME=localstack
volumes:
- "${TMPDIR:-./localstack}:/tmp/localstack"
- '/var/run/docker.sock:/var/run/docker.sock'
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
volumes:
test_database_data: