Add Docker configuration for Odoo deployment, docker-compose (postgres and odoo) & .env

This commit is contained in:
root 2025-10-06 08:42:51 +00:00
commit b6e7615920
3 changed files with 66 additions and 0 deletions

8
.env Normal file
View File

@ -0,0 +1,8 @@
# PostgreSQL Database Configuration
POSTGRES_DB=odoo
POSTGRES_USER=odoo
POSTGRES_PASSWORD=odoo_secure_password_2025
POSTGRES_HOST=db
# Odoo Configuration
ODOO_PORT=8069

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
TP4.pdf
git-commits-plan.csv
.claude

55
docker-compose.yml Normal file
View File

@ -0,0 +1,55 @@
services:
db:
image: postgres:15
container_name: odoo_db
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
networks:
- odoo-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
odoo:
image: odoo:17
container_name: odoo_app
depends_on:
db:
condition: service_healthy
environment:
- HOST=${POSTGRES_HOST}
- USER=${POSTGRES_USER}
- PASSWORD=${POSTGRES_PASSWORD}
ports:
- "${ODOO_PORT}:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
networks:
- odoo-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8069/web/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
volumes:
odoo-web-data:
driver: local
odoo-db-data:
driver: local
networks:
odoo-network:
driver: bridge