Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (63 loc) · 1.52 KB
/
Copy pathdocker-compose.yml
File metadata and controls
66 lines (63 loc) · 1.52 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
version: "3.8"
services:
database:
image: postgres:15
container_name: postgres_db
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: test_db
ports:
- "5432:5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d test_db"]
interval: 5s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend_service
depends_on:
database:
condition: service_healthy
environment:
- DB_HOST=database
- DB_PORT=5432
- DB_NAME=test_db
- DB_USER=user
- DB_PASSWORD=password
- AWS_ENDPOINT_URL=http://localstack:4566
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
ports:
- "8000:8000"
volumes:
- ./backend:/app
localstack:
image: localstack/localstack
container_name: localstack
environment:
- SERVICES=s3
- DEBUG=1
- AWS_DEFAULT_REGION=us-east-1
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- DOCKER_HOST=unix:///var/run/docker.sock
ports:
- "4566:4566"
- "4572:4572"
volumes:
- "./localstack:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
healthcheck:
test: ["CMD", "awslocal", "s3", "ls"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_data: