-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (81 loc) · 2.5 KB
/
docker-compose.yml
File metadata and controls
86 lines (81 loc) · 2.5 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
# Docker Compose for python-project-template
# Simplified development setup
services:
# =============================================================================
# Main application
# =============================================================================
app:
build:
context: .
dockerfile: Dockerfile
container_name: python-template-app
volumes:
# Hot reload: mount source code
- ./python_package_template:/app/python_package_template
- ./tests:/app/tests
- ./pyproject.toml:/app/pyproject.toml:ro
ports:
- "8000:8000" # Main application
- "8080:8080" # Documentation server
- "5678:5678" # Debug port
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
- DEVELOPMENT=true
command: python -m python_package_template.python_module_template
restart: unless-stopped
# =============================================================================
# Test runner
# =============================================================================
test:
build:
context: .
dockerfile: Dockerfile
container_name: python-template-test
volumes:
- ./:/app:ro
environment:
- PYTHONPATH=/app
- PYTHONUNBUFFERED=1
command: task test
profiles:
- test
# =============================================================================
# Documentation server
# =============================================================================
docs:
build:
context: .
dockerfile: Dockerfile
container_name: python-template-docs
volumes:
- ./python_package_template:/app/python_package_template:ro
- ./pyproject.toml:/app/pyproject.toml:ro
ports:
- "8080:8080"
environment:
- PYTHONPATH=/app
command: task doc-serve
profiles:
- docs
# =============================================================================
# Code quality checks
# =============================================================================
quality:
build:
context: .
dockerfile: Dockerfile
container_name: python-template-quality
volumes:
- ./:/app:ro
environment:
- PYTHONPATH=/app
command: bash -c "task lint && task static-check"
profiles:
- quality
# =============================================================================
# Networks
# =============================================================================
networks:
default:
name: python-template-network