-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
126 lines (117 loc) · 2.67 KB
/
docker-compose.yaml
File metadata and controls
126 lines (117 loc) · 2.67 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
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
services:
app:
build:
context: .
dockerfile: dev.Dockerfile
working_dir: /app
restart: always
depends_on:
db:
condition: "service_healthy"
command: bash -c "uv run ffcops serve"
environment:
FFC_OPERATIONS_POSTGRES_HOST: db
env_file:
- .env
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "8000"]
interval: 1s
timeout: 1s
retries: 15
develop:
watch:
- action: rebuild
path: uv.lock
- action: rebuild
path: Dockerfile
- action: rebuild
path: dev.Dockerfile
- action: sync+restart
path: app/
target: /app/app
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686" # UI
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "16686"]
interval: 1s
timeout: 1s
retries: 15
depends_on:
app:
condition: "service_healthy"
db: &db
image: postgres:17
restart: unless-stopped
environment:
POSTGRES_DB: "${FFC_OPERATIONS_POSTGRES_DB}"
POSTGRES_USER: "${FFC_OPERATIONS_POSTGRES_USER}"
POSTGRES_PASSWORD: "${FFC_OPERATIONS_POSTGRES_PASSWORD}"
ports:
- "${FFC_OPERATIONS_POSTGRES_PORT}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready --dbname=$${POSTGRES_DB} --username=$${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./pg_data:/var/lib/postgresql/data
test_db:
<<: *db
ports:
- "${FFC_OPERATIONS_POSTGRES_TEST_PORT}:5432"
volumes: []
tmpfs:
- /var/lib/postgresql/data
app_test:
build:
context: .
dockerfile: dev.Dockerfile
depends_on:
test_db:
condition: "service_healthy"
command: >
bash -c "
set -e
# Run Ruff to check code style
uv run ruff check .
# Check formatting with Ruff
uv run ruff format --check --diff .
# Run tests with pytest
uv run pytest
"
env_file:
- .env
bash:
build:
context: .
dockerfile: dev.Dockerfile
command: bash
stdin_open: true
tty: true
env_file:
- .env
format:
build:
context: .
dockerfile: dev.Dockerfile
command: >
bash -c "
set -e
# Run Ruff to fix code style
uv run ruff check . --fix --fix-only --show-fixes
# Run Ruff to format code
uv run ruff format .
"
env_file:
- .env
bandit:
build:
context: .
dockerfile: dev.Dockerfile
command: bash -c "uv run bandit -c pyproject.toml -r ."
env_file:
- .env