-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
118 lines (109 loc) · 2.77 KB
/
docker-compose.yml
File metadata and controls
118 lines (109 loc) · 2.77 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
services:
# PGAdmin4
pgadmin:
image: dpage/pgadmin4:latest
container_name: pest_control_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@pestcontrol.com
PGADMIN_DEFAULT_PASSWORD: admin123
PGADMIN_CONFIG_SERVER_MODE: 'False'
ports:
- "5050:80"
depends_on:
- postgres
networks:
- pest_network
restart: unless-stopped
volumes:
- pgadmin_data:/var/lib/pgadmin
# Base de datos PostgreSQL 17
postgres:
image: postgres:17-alpine
container_name: pest_control_db
restart: unless-stopped
environment:
POSTGRES_DB: pest_control
POSTGRES_USER: pestuser
POSTGRES_PASSWORD: pestpass123
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- pest_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pestuser -d pest_control"]
interval: 10s
timeout: 5s
retries: 5
# Backend Node.js con SSL
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: pest_control_backend
restart: unless-stopped
environment:
ENVIRONMENT: production
PORT: 8000
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: pest_control
DB_USER: pestuser
DB_PASSWORD: pestpass123
DB_SSL: false
DB_REQUIRE_SSL: false
JWT_SECRET: tu_jwt_secret_super_seguro_2024
SSL_ENABLED: true
USE_HTTPS: true
LOG_QUERIES: false
LOG_ERRORS: true
ports:
- "8000:8000"
volumes:
- ./backend/logs:/app/logs
networks:
- pest_network
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "--no-check-certificate", "https://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 40s
# Frontend Flutter Web con SSL
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: pest_control_frontend
restart: unless-stopped
environment:
- FLUTTER_WEB=true
- API_BASE_URL=https://pest_control_backend:8000/api
- ENVIRONMENT=production
ports:
- "8080:8080"
volumes:
- ./frontend/build/web:/app/web:ro
- ./backend/certs:/app/certs:ro
networks:
- pest_network
depends_on:
backend:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "--no-check-certificate", "https://localhost:8080"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgres_data:
driver: local
pgadmin_data:
networks:
pest_network:
driver: bridge