[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-bad38816-b897-4336-91af-dc885033c44a":3,"$fVctuTUrWNNIlPeppRtAHbWWnZ1lZ8YE2mEEoSlm-f8E":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"bad38816-b897-4336-91af-dc885033c44a","odoo-docker-deployment","适用于Odoo的Docker和docker-compose配置，包括PostgreSQL、持久化卷、基于环境的配置和Nginx反向代理。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: odoo-docker-deployment\ndescription: \"Production-ready Docker and docker-compose setup for Odoo with PostgreSQL, persistent volumes, environment-based configuration, and Nginx reverse proxy.\"\nrisk: safe\nsource: \"self\"\n---\n\n# Odoo Docker Deployment\n\n## Overview\n\nThis skill provides a complete, production-ready Docker setup for Odoo, including PostgreSQL, persistent file storage, environment variable configuration, and an optional Nginx reverse proxy with SSL. It covers both development and production configurations.\n\n## When to Use This Skill\n\n- Spinning up a local Odoo development environment with Docker.\n- Deploying Odoo to a VPS or cloud server (AWS, DigitalOcean, etc.).\n- Troubleshooting Odoo container startup failures or database connection errors.\n- Adding a reverse proxy with SSL to an existing Odoo Docker setup.\n\n## How It Works\n\n1. **Activate**: Mention `@odoo-docker-deployment` and describe your deployment scenario.\n2. **Generate**: Receive a complete `docker-compose.yml` and `odoo.conf` ready to run.\n3. **Debug**: Describe your container error and get a diagnosis with a fix.\n\n## Examples\n\n### Example 1: Production docker-compose.yml\n\n```yaml\n# Note: The top-level 'version' key is deprecated in Docker Compose v2+\n# and can be safely omitted. Remove it to avoid warnings.\n\nservices:\n  db:\n    image: postgres:15\n    restart: always\n    environment:\n      POSTGRES_DB: odoo\n      POSTGRES_USER: odoo\n      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}\n    volumes:\n      - postgres-data:\u002Fvar\u002Flib\u002Fpostgresql\u002Fdata\n    networks:\n      - odoo-net\n\n  odoo:\n    image: odoo:17.0\n    restart: always\n    depends_on:\n      db:\n        condition: service_healthy\n    ports:\n      - \"8069:8069\"\n      - \"8072:8072\"   # Longpolling for live chat \u002F bus\n    environment:\n      HOST: db\n      USER: odoo\n      PASSWORD: ${POSTGRES_PASSWORD}\n    volumes:\n      - odoo-web-data:\u002Fvar\u002Flib\u002Fodoo\n      - .\u002Faddons:\u002Fmnt\u002Fextra-addons   # Custom modules\n      - .\u002Fodoo.conf:\u002Fetc\u002Fodoo\u002Fodoo.conf\n    networks:\n      - odoo-net\n\nvolumes:\n  postgres-data:\n  odoo-web-data:\n\nnetworks:\n  odoo-net:\n```\n\n### Example 2: odoo.conf\n\n```ini\n[options]\nadmin_passwd = ${ODOO_MASTER_PASSWORD}    ; set via env or .env file\ndb_host = db\ndb_port = 5432\ndb_user = odoo\ndb_password = ${POSTGRES_PASSWORD}        ; set via env or .env file\n\n; addons_path inside the official Odoo Docker image (Debian-based)\naddons_path = \u002Fmnt\u002Fextra-addons,\u002Fusr\u002Flib\u002Fpython3\u002Fdist-packages\u002Fodoo\u002Faddons\n\nlogfile = \u002Fvar\u002Flog\u002Fodoo\u002Fodoo.log\nlog_level = warn\n\n; Worker tuning for a 4-core \u002F 8GB server:\nworkers = 9                ; (CPU cores × 2) + 1\nmax_cron_threads = 2\nlimit_memory_soft = 1610612736   ; 1.5 GB — soft kill threshold\nlimit_memory_hard = 2147483648   ; 2.0 GB — hard kill threshold\nlimit_time_cpu = 600\nlimit_time_real = 1200\nlimit_request = 8192\n```\n\n### Example 3: Common Commands\n\n```bash\n# Start all services in background\ndocker compose up -d\n\n# Stream Odoo logs in real time\ndocker compose logs -f odoo\n\n# Restart Odoo only (not DB — avoids data risk)\ndocker compose restart odoo\n\n# Stop all services\ndocker compose down\n\n# Backup the database to a local SQL dump\ndocker compose exec db pg_dump -U odoo odoo > backup_$(date +%Y%m%d).sql\n\n# Update a custom module without restarting the server\ndocker compose exec odoo odoo -d odoo --update my_module --stop-after-init\n```\n\n## Best Practices\n\n- ✅ **Do:** Store all secrets in a `.env` file and reference them with `${VAR}` — never hardcode passwords in `docker-compose.yml`.\n- ✅ **Do:** Use `depends_on: condition: service_healthy` with a PostgreSQL healthcheck to prevent Odoo starting before the DB is ready.\n- ✅ **Do:** Put Nginx in front of Odoo for SSL termination (Let's Encrypt \u002F Certbot) — never expose Odoo directly on port 80\u002F443.\n- ✅ **Do:** Set `workers = (CPU cores × 2) + 1` in `odoo.conf` — `workers = 0` uses single-threaded mode and blocks all users.\n- ❌ **Don't:** Expose port 5432 (PostgreSQL) to the public internet — keep it on the internal Docker network only.\n- ❌ **Don't:** Use the `latest` or `17` Docker image tags in production — always pin to a specific patch-level tag (e.g., `odoo:17.0`).\n- ❌ **Don't:** Mount `odoo.conf` and rely on it for secrets in CI\u002FCD — use Docker secrets or environment variables instead.\n\n## Limitations\n\n- This skill covers **self-hosted Docker deployments** — Odoo.sh (cloud-managed hosting) has a completely different deployment model.\n- **Horizontal scaling** (multiple Odoo containers behind a load balancer) requires shared filestore (NFS or S3-compatible storage) not covered here.\n- Does not include an Nginx configuration template — consult the [official Odoo Nginx docs](https:\u002F\u002Fwww.odoo.com\u002Fdocumentation\u002F17.0\u002Fadministration\u002Finstall\u002Fdeploy.html) for the full reverse proxy config.\n- The `addons_path` inside the Docker image may change with new base image versions — always verify after upgrading the Odoo image.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,215,1353,"2026-05-16 13:31:58",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"ae63a542-5ac4-4217-a826-0403abb2cb8e","1.0.0","odoo-docker-deployment.zip",2355,"uploads\u002Fskills\u002Fbad38816-b897-4336-91af-dc885033c44a\u002Fodoo-docker-deployment.zip","715617dbbc7e3ab412300c2f0783737dc81d0163e1c4ef4af529c95be17a7b04","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":4955}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]