-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
62 lines (58 loc) · 2.03 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
# Simplify running the application inside a container locally.
# Usage: `docker-compose up`
#
# Do not use docker-compose in production environments.
#
version: '3.4'
x-aws-variables: &aws-variables
AWS_ENDPOINT_URL: http://localstack:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_REGION: us-east-1
EVENTS_SNS_TOPIC_ARN: arn:aws:sns:us-east-1:000000000000:events-sns-topic-dev
S3_BUCKET_NAME: crime-apply-documents-dev
services:
db:
image: postgres:15.2-alpine
environment:
POSTGRES_HOST_AUTH_METHOD: trust
# Used to emulate AWS for local development
localstack:
image: localstack/localstack:latest
ports:
- "4566:4566" # localstack gateway
- "4510-4559:4510-4559" # external services port range
environment:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1 # only this region works for SNS in localstack
S3_SKIP_SIGNATURE_VALIDATION: 0
DOCKER_HOST: unix:///var/run/docker.sock
SERVICES: s3,sns
volumes:
- ./config/localstack/ready.sh:/etc/localstack/init/ready.d/ready.sh
- ./config/localstack/shutdown.sh:/etc/localstack/init/shutdown.d/shutdown.sh
- ./docker/localstack-volume:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
web:
build: .
environment:
<<: *aws-variables
ENV_NAME: production
RACK_ENV: production
RAILS_ENV: production
PORT: 3003
SECRET_KEY_BASE: 90957b5f6dab71710443434b3541698a2017f7dd01d9a19acae5b0fc8a64b3a6
DATABASE_URL: postgresql://postgres@db/laa-criminal-applications-datastore
DATABASE_SSLMODE: disable
DISABLE_HTTPS: "1"
RAILS_SERVE_STATIC_FILES: "1"
ENABLE_PROMETHEUS_EXPORTER: "false" # can be enabled for quick tests
PROMETHEUS_EXPORTER_PORT: 9397
API_AUTH_SECRET_APPLY: foobar
API_AUTH_SECRET_REVIEW: foobar
ports:
- "3003:3003" # puma server (rails app)
- "9397:9397" # prometheus exporter `/metrics` endpoint
depends_on:
- db