-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
81 lines (76 loc) · 1.71 KB
/
docker-compose.yaml
File metadata and controls
81 lines (76 loc) · 1.71 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
services:
pynews-api:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: pynews-server
ports:
- "8000:8000"
env_file:
- .env
restart: unless-stopped
volumes:
- sqlite_data:/app/data
environment:
- SQLITE_PATH=/app/data/pynewsdb.db
- SQLITE_URL=sqlite+aiosqlite:////app/data/pynewsdb.db
depends_on:
- sqlite-init
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/healthcheck"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
sqlite-init:
image: alpine:latest
container_name: pynews-sqlite-init
volumes:
- sqlite_data:/data
command: >
sh -c "
mkdir -p /data &&
touch /data/pynewsdb.db &&
chmod 777 /data &&
chmod 666 /data/pynewsdb.db &&
chown -R root:root /data &&
echo 'SQLite database initialized'
"
restart: "no"
scanapi-tests:
build:
context: .
dockerfile: Dockerfile
target: scanapi-test
container_name: scanapi-tests
env_file:
- .env
environment:
- BASE_URL=http://pynews-server:8000
volumes:
- report-data:/server/scanapi
depends_on:
pynews-api:
condition: service_healthy
command: poetry run scanapi run
scanapi-report-viewer:
image: nginx:alpine
container_name: scanapi-report-viewer
ports:
- "8080:80"
volumes:
- report-data:/usr/share/nginx/html:ro
depends_on:
- scanapi-tests
volumes:
report-data:
sqlite_data:
driver: local
driver_opts:
type: none
o: bind
device: ./data
networks:
default:
name: pynews-network