This repository was archived by the owner on May 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
132 lines (128 loc) · 3.53 KB
/
docker-compose.yml
File metadata and controls
132 lines (128 loc) · 3.53 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
127
128
129
130
131
132
version: "3.8"
services:
odoo:
build: .
container_name: odoo
ports:
- "${ODOO_PORT}:8069" # Odoo port from .env
env_file:
- .env # Load environment variables from .env file
environment:
- ODOO_DB_HOST=${ODOO_DB_HOST}
- ODOO_DB_PORT=${ODOO_DB_PORT}
- ODOO_DB_USER=${ODOO_DB_USER}
- ODOO_DB_PASSWORD=${ODOO_DB_PASSWORD}
- ODOO_DB_NAME=${ODOO_DB_NAME}
- ENVIRONMENT=${ENVIRONMENT} # Example: development or production
- ODOO_DEBUG_ASSETS=${ODOO_DEBUG_ASSETS} # True or False
- ODOO_DEV_MODE=${ODOO_DEV_MODE} # e.g., assets
- ODOO_LOGFILE=${ODOO_LOGFILE}
- ADMIN_PASSWD=${ADMIN_PASSWD}
volumes:
- .:/app # Bind mount the project directory (for development hot-reload)
- ./config:/config:ro # Read-only mount for configuration template
- ./logs:/var/log/odoo # Persist logs
- ./custom_addons:/mnt/extra-addons:ro # Read-only mount for custom addons
- ./filestore:/home/odoo/.local/share/Odoo/filestore # Persist filestore data
- ./sessions:/home/odoo/.local/share/Odoo/sessions # Persist session data
depends_on:
db:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8069/web/login"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: "2.0"
memory: 4G
reservations:
cpus: "1.0"
memory: 2G
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- odoo_net
db:
image: postgres:15
container_name: odoo_db
env_file:
- .env
environment:
- POSTGRES_USER=${ODOO_DB_USER}
- POSTGRES_PASSWORD=${ODOO_DB_PASSWORD}
- POSTGRES_DB=${ODOO_DB_NAME}
ports:
- "${DB_PORT:-5432}:5432" # Use DB_PORT variable if defined, else default to 5432
volumes:
- ./postgresql/data/pgdata:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${ODOO_DB_USER}"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: "1.0"
memory: 2G
reservations:
cpus: "0.5"
memory: "1G"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- odoo_net
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
env_file:
- .env
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
ports:
- "5050:80"
depends_on:
db:
condition: service_healthy
volumes:
- ./pgadmin/data:/var/lib/pgadmin
- ./pgadmin/config/servers.json:/pgadmin4/servers.json:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 60s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: "0.5"
memory: "512M"
reservations:
cpus: "0.2"
memory: "256M"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- odoo_net
networks:
odoo_net:
driver: bridge