-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (75 loc) · 1.9 KB
/
docker-compose.yml
File metadata and controls
80 lines (75 loc) · 1.9 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
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: canner_postgres
environment:
POSTGRES_DB: canner_dev
POSTGRES_USER: developer
POSTGRES_PASSWORD: devpassword
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=C --lc-ctype=C"
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/01-init.sql
- ./database/seed.sql:/docker-entrypoint-initdb.d/02-seed.sql
networks:
- canner_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U developer -d canner_dev"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Backend Flask Application
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: canner_backend
environment:
- DATABASE_URL=postgresql://developer:devpassword@postgres:5432/canner_dev
- FLASK_ENV=development
- FLASK_DEBUG=1
- FLASK_APP=app.py
ports:
- "5000:5000"
volumes:
- ./backend:/app
- /app/__pycache__
depends_on:
postgres:
condition: service_healthy
networks:
- canner_network
restart: unless-stopped
# Self-retryable app - no wait script needed!
command: ["python", "app.py"]
# pgAdmin for database management (optional)
pgadmin:
image: dpage/pgadmin4:latest
container_name: canner_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@canner.dev
PGADMIN_DEFAULT_PASSWORD: admin123
PGADMIN_CONFIG_SERVER_MODE: "False"
ports:
- "8080:80"
volumes:
- pgadmin_data:/var/lib/pgadmin
depends_on:
- postgres
networks:
- canner_network
profiles:
- admin
volumes:
postgres_data:
driver: local
pgadmin_data:
driver: local
networks:
canner_network:
driver: bridge