Deploying Odoo in Coolify - Full deployment integration with Github

Architecture Overview

This setup uses two Coolify-managed containers:

  1. Modules Container: Pulls modules from GitHub and keeps them available in a volume
  2. Odoo Container: Uses the modules by mounting the volume to /mnt/extra-addons

Implementation Steps

1. Create Modules Repository

  1. Create a GitHub repository for your custom Odoo modules
  2. Add a Dockerfile in the root with the following content:

    dockerfile

    Copy

    FROM alpine:latest # Install git for fetching updates RUN apk add --no-cache git # Create odoo user and group with the same IDs as in the Odoo container RUN addgroup -g 101 odoo && adduser -u 101 -G odoo -h /mnt/extra-addons -D odoo # Set working directory WORKDIR /mnt/extra-addons # Copy all modules from the repository COPY . /mnt/extra-addons/ # Change ownership to odoo user RUN chown -R odoo:odoo /mnt/extra-addons # Keep container running CMD ["tail", "-f", "/dev/null"]

  3. Add your custom Odoo modules to the root of the repository

2. Deploy Modules Container in Coolify

  1. Create a new service in Coolify
  2. Select "Dockerfile" as the build pack
  3. Point to your GitHub repository with custom modules
  4. Configure auto-deployment from GitHub (optional)
  5. You need to give a volume name (xyzsss-modules) under Persistence storage in your container
  6. Leave the  Source Path and put /mnt/extra-addons as the Destination Path
  7. Deplor or Redeploy your container

3. Configure Odoo Container

  1. Deploy a standard Odoo service using a coolify service, search for odoo and deploy it. The current docker image for odoo is at v17 but you can always use any available docker image.
  2. Modify the docker-compose.yml to use a bind mount to the modules:

    yaml file


    services: odoo: image: 'odoo:17' environment: # Your environment variables volumes: - 'odoo-web-data:/var/lib/odoo' - '/var/lib/docker/volumes/xyzsss-modules/_data:/mnt/extra-addons' # Rest of your configuration volumes: odoo-web-data: postgresql-data:

  3. Replace xyzsss-modules with your actual volume name
  4. We need to include /_data in our bind mount path because we're directly accessing Docker's internal storage structure. If we only specified the volume name without /_data, we would be pointing to the volume's metadata directory rather than the actual content.
  5. Deploy the Odoo service

4. Verify Configuration

  1. Connect to the Odoo container and check modules:

    bash command


    docker exec -it $(docker ps | grep odoo | awk '{print $1}') ls -la /mnt/extra-addons

  2. Log in to Odoo as admin
  3. Go to Apps
  4. Click "Update Apps List"
  5. Search for and install your custom modules

5. Auto-Deployment Workflow

When changes are pushed to your GitHub repository:

  1. Coolify pulls the latest code to the modules container
  2. The updated modules are immediately available to Odoo container
  3. In Odoo, you can update the modules to apply changes

Troubleshooting

  • Empty /mnt/extra-addons: Check volume names and paths
  • Modules not showing in Odoo: Run "Update Apps List" in Odoo
  • Permission issues: Verify the modules are owned by odoo

Maintenance

  • Monitor disk space for Docker volumes
  • Regularly backup your Odoo database
  • Consider implementing a staging environment for testing module changes