-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
70 lines (64 loc) · 2.66 KB
/
docker-compose.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
# docker-compose.yml
services:
# Fragments microservice API server
fragments:
# give the container a name
container_name: fragments
# Use a proper init process (tini)
init: true
# Build the Docker Image using the Dockerfile
# and current directory as the build context
build: .
# Environment variables to use
environment:
# Our API will be running on http://localhost:8080
- API_URL=http://localhost:8080
# Use Basic Auth (for running tests, CI)
- HTPASSWD_FILE=tests/.htpasswd
# Use the LOG_LEVEL set in the host environment, or default to info
- LOG_LEVEL=${LOG_LEVEL:-info}
- AWS_REGION=us-east-1
# Use the LocalStack endpoint vs. AWS for S3 AWS SDK clients.
# NOTE: we use Docker's internal network to the localstack container
- AWS_S3_ENDPOINT_URL=http://localstack:4566
# Use the DynamoDB local endpoint vs. AWS for DynamoDB AWS SDK clients.
- AWS_DYNAMODB_ENDPOINT_URL=http://dynamodb-local:8000
# This S3 bucket and DynamoDB table need to get created first, see
# local-aws-setup.sh. We'll default to 'fragments' as the name, unless
# something else is defined in the env.
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-fragments}
- AWS_DYNAMODB_TABLE_NAME=${AWS_DYNAMODB_TABLE_NAME:-fragments}
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_SESSION_TOKEN=test
- AWS_DEFAULT_REGION=us-east-1
# Ports to publish
ports:
- '8080:8080'
# DynamoDB Local, see: https://hub.docker.com/r/amazon/dynamodb-local
dynamodb-local:
# give the container a name
container_name: dynamodb-local
image: amazon/dynamodb-local
ports:
# Default port is 8000
- '8000:8000'
# Run the database in memory, see:
# https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.UsageNotes.html
command: ['-jar', 'DynamoDBLocal.jar', '-inMemory']
# LocalStack for S3, see https://docs.localstack.cloud/get-started/#docker-compose
# Interact via awscli-local, see https://docs.localstack.cloud/integrations/aws-cli/#installation
localstack:
# give the container a name
container_name: localstack-s3
# https://hub.docker.com/r/localstack/localstack
image: localstack/localstack
ports:
- '4566:4566'
environment:
# See https://docs.localstack.cloud/localstack/configuration/ and
# https://hub.docker.com/r/localstack/localstack for config details.
# We only want to run S3
- SERVICES=s3
# We're always working in us-east-1
- DEFAULT_REGION=us-east-1