-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
172 lines (160 loc) · 4.55 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
services:
finance-hub:
image: 311462405659.dkr.ecr.eu-west-1.amazonaws.com/sirius/sirius-finance-hub:latest
build:
dockerfile: docker/finance-hub/Dockerfile
ports:
- "8888:8888"
environment:
PORT: 8888
SIRIUS_PUBLIC_URL: http://localhost:8080
SIRIUS_URL: http://json-server:3000
BACKEND_URL: http://finance-api:8080
PREFIX: /finance
healthcheck:
test: wget -O /dev/null -S 'http://localhost:8888/finance/health-check' 2>&1 | grep 'HTTP/1.1 200 OK' || exit 1
interval: 15s
timeout: 10s
retries: 3
start_period: 30s
depends_on:
- json-server
- finance-api
finance-api:
image: 311462405659.dkr.ecr.eu-west-1.amazonaws.com/sirius/sirius-finance-api:latest
build:
dockerfile: docker/finance-api/Dockerfile
ports:
- "8181:8080"
environment:
POSTGRES_CONN: sirius-db:5432
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: finance
AWS_REGION: eu-west-1
AWS_BASE_URL: http://localstack:4566
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack
EVENT_BUS_NAME: local-main
S3_ENCRYPTION_KEY: alias/aws/s3
SIRIUS_PUBLIC_URL: http://localhost:8080
FINANCE_ADMIN_PREFIX: /supervision/finance-admin
healthcheck:
test: wget -O /dev/null -S 'http://localhost:8080/health-check' 2>&1 | grep 'HTTP/1.1 200 OK' || exit 1
interval: 15s
timeout: 10s
retries: 3
start_period: 30s
depends_on:
sirius-db:
condition: service_healthy
json-server:
build:
dockerfile: json-server/Dockerfile
ports:
- '3000:3000'
cypress:
build:
dockerfile: docker/cypress/Dockerfile
command: [ "--headless", "-b", "electron" ]
volumes:
- ./cypress/screenshots:/root/cypress/screenshots:rw,delegated
- ./cypress/logs:/root/cypress/logs:rw,delegated
depends_on:
finance-hub:
condition: service_healthy
go-lint:
image: golangci/golangci-lint:v1.63.4
working_dir: /go/src/app
volumes:
- ./:/go/src/app
- ./.cache/golangci-lint/v1.53.3:/root/.cache
command: golangci-lint run -v --timeout 5m
trivy:
image: aquasec/trivy:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.trivy-cache:/root/.cache
- ./test-results:/test-results
- ./.trivyignore:/.trivyignore
environment:
- TRIVY_DB_REPOSITORY=${TRIVY_DB_REPOSITORY}
- TRIVY_JAVA_DB_REPOSITORY=${TRIVY_JAVA_DB_REPOSITORY}
- TRIVY_USERNAME=${DOCKER_USERNAME}
- TRIVY_PASSWORD=${DOCKER_PASSWORD}
yarn:
image: node:22-alpine3.19
working_dir: /home/node/app
entrypoint: yarn
volumes:
- ./finance-hub:/home/node/app
sirius-db:
image: postgres:13-alpine
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: finance
ports:
- "5431:5432"
volumes:
- ./migrations/1_baseline.sql:/docker-entrypoint-initdb.d/1_baseline.sql
- ./test-data/seed_data.sql:/seed_data.sql
healthcheck:
test: pg_isready --username=user --dbname=finance
interval: 5s
timeout: 5s
retries: 5
sqlc-gen:
image: kjconroy/sqlc
working_dir: /src
volumes:
- ./finance-api/internal/store:/src
- ./migrations:/schema
command: generate
sqlc-diff:
image: kjconroy/sqlc
working_dir: /src
volumes:
- ./finance-api/internal/store:/src
- ./migrations:/schema
command: diff
sqlc-vet:
image: kjconroy/sqlc
environment:
POSTGRES_CONN: localhost:5432
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: finance
POSTGRES_SEARCH_PATH: supervision_finance
working_dir: /src
volumes:
- ./finance-api/internal/store:/src
- ./migrations:/schema
command: vet
depends_on:
- finance-migration
finance-migration:
image: 311462405659.dkr.ecr.eu-west-1.amazonaws.com/sirius/sirius-finance-migration:latest
build:
dockerfile: docker/finance-migration/Dockerfile
depends_on:
sirius-db:
condition: service_healthy
environment:
DB_USER: user
DB_PASSWORD: password
DB_CONNECTION: sirius-db:5432
DB_NAME: finance
DB_SCHEMA: supervision_finance
command: "up"
localstack:
image: localstack/localstack:4.0
ports:
- "4566:4566"
environment:
AWS_DEFAULT_REGION: eu-west-1
healthcheck:
test: bash /scripts/wait/healthcheck.sh
interval: 10s
timeout: 10s
retries: 50