PageSourceSearch

https://caprover.com/assets/js/62e194f3.9d97ff0b.js

js caprover.com collected 2026-10-03 19:22:54 UTC 6,676 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkcaprover_docs_site=self.webpackChunkcaprover_docs_site||[]).push([["5044"],{6172(e,s,n){n.r(s),n.d(s,{metadata:()=>r,default:()=>p,frontMatter:()=>i,contentTitle:()=>c,toc:()=>d,assets:()=>a});var r=JSON.parse('{"id":"docker-compose","title":"Docker Compose","description":"CapRover can deploy a supported subset of Docker Compose directly from the dashboard. This feature is useful for creating several related apps together, but it is still experimental and does not implement the complete Compose specification.","source":"@site/../content/en/docs/docker-compose.md","sourceDirName":".","slug":"/docker-compose","permalink":"/docs/docker-compose","draft":false,"unlisted":false,"editUrl":"https://github.com/caprover/caprover-website/edit/master/content/en/docs/docker-compose.md","tags":[],"version":"current","frontMatter":{"id":"docker-compose","title":"Docker Compose","sidebar_label":"Docker Compose"},"sidebar":"docs","previous":{"title":"Stateless with Persistent data","permalink":"/docs/stateless-with-persistent-data"},"next":{"title":"Intro","permalink":"/docs/ci-cd-integration"}}'),o=n(4848),t=n(8453);let i={id:"docker-compose",title:"Docker Compose",sidebar_label:"Docker Compose"},c,a={},d=[{value:"Deploy a Compose file",id:"deploy-a-compose-file",level:2},{value:"Supported fields",id:"supported-fields",level:2},{value:"Running Compose outside CapRover",id:"running-compose-outside-caprover",level:2}];function l(e){let s={code:"code",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.p,{children:"CapRover can deploy a supported subset of Docker Compose directly from the dashboard. This feature is useful for creating several related apps together, but it is still experimental and does not implement the complete Compose specification."}),"\n",(0,o.jsx)(s.h2,{id:"deploy-a-compose-file",children:"Deploy a Compose file"}),"\n",(0,o.jsxs)(s.ol,{children:["\n",(0,o.jsxs)(s.li,{children:["Open ",(0,o.jsx)(s.strong,{children:"Apps"})," in the CapRover dashboard."]}),"\n",(0,o.jsxs)(s.li,{children:["Select ",(0,o.jsx)(s.strong,{children:"Docker Compose"}),"."]}),"\n",(0,o.jsx)(s.li,{children:"Paste your Compose YAML into the editor."}),"\n",(0,o.jsx)(s.li,{children:"Review the generated apps, then deploy."}),"\n"]}),"\n",(0,o.jsx)(s.p,{children:"For example:"}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-yaml",children:"services:\n  db:\n    image: mysql:8.4\n    volumes:\n      - db-data:/var/lib/mysql\n    environment:\n      MYSQL_ROOT_PASSWORD: change-this-password\n      MYSQL_DATABASE: wordpress\n      MYSQL_USER: wordpress\n      MYSQL_PASSWORD: change-this-password\n\n  wordpress:\n    depends_on:\n      - db\n    image: wordpress:latest\n    environment:\n      WORDPRESS_DB_HOST: db:3306\n      WORDPRESS_DB_USER: wordpress\n      WORDPRESS_DB_PASSWORD: change-this-password\n      WORDPRESS_DB_NAME: wordpress\n"})}),"\n",(0,o.jsxs)(s.p,{children:["Services in the same deployment can reach one another by service name, such as ",(0,o.jsx)(s.code,{children:"db:3306"})," in this example. Apps created by current CapRover versions use their app name as the Docker service name. Apps upgraded from releases before 1.15 may retain a physical service name such as ",(0,o.jsx)(s.code,{children:"srv-captain--db"}),"; CapRover keeps the prefixed network alias for compatibility."]}),"\n",(0,o.jsx)(s.h2,{id:"supported-fields",children:"Supported fields"}),"\n",(0,o.jsx)(s.p,{children:"The current parser supports these service fields:"}),"\n",(0,o.jsxs)(s.ul,{children:["\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"image"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"environment"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"ports"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"volumes"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"depends_on"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"hostname"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"cap_add"})}),"\n",(0,o.jsx)(s.li,{children:(0,o.jsx)(s.code,{children:"command"})}),"\n"]}),"\n",(0,o.jsxs)(s.p,{children:["Other Compose fields are ignored. In particular, check files that rely on ",(0,o.jsx)(s.code,{children:"build"}),", ",(0,o.jsx)(s.code,{children:"container_name"}),", custom ",(0,o.jsx)(s.code,{children:"networks"}),", ",(0,o.jsx)(s.code,{children:"secrets"}),", ",(0,o.jsx)(s.code,{children:"configs"}),", ",(0,o.jsx)(s.code,{children:"deploy"}),", or ",(0,o.jsx)(s.code,{children:"restart"}),". Configure the equivalent behavior in the generated app's CapRover settings where available."]}),"\n",(0,o.jsxs)(s.p,{children:["Named volumes referenced by a service are created and managed by CapRover. Compose ",(0,o.jsx)(s.code,{children:"ports"})," entries must use the ",(0,o.jsx)(s.code,{children:"HOST:CONTAINER"})," form. Review each generated app after deployment to confirm its HTTP port, persistent directories, port mappings, environment variables, and dependencies."]}),"\n",(0,o.jsx)(s.h2,{id:"running-compose-outside-caprover",children:"Running Compose outside CapRover"}),"\n",(0,o.jsxs)(s.p,{children:["If your stack requires unsupported Compose features, you can manage it directly with ",(0,o.jsx)(s.code,{children:"docker 
1compose"}),". To make one of those services reachable from a CapRover app, attach it to the external ",(0,o.jsx)(s.code,{children:"captain-overlay-network"}),":"]}),"\n",(0,o.jsx)(s.pre,{children:(0,o.jsx)(s.code,{className:"language-yaml",children:"services:\n  web-app:\n    image: your-image:latest\n    networks:\n      - captain-overlay-network\n\nnetworks:\n  captain-overlay-network:\n    external: true\n"})}),"\n",(0,o.jsxs)(s.p,{children:["You can then create a CapRover ",(0,o.jsx)(s.strong,{children:"Nginx Reverse Proxy"})," app with an upstream such as ",(0,o.jsx)(s.code,{children:"http://web-app"}),". Services started directly with Docker Compose remain outside CapRover's deployment, scaling, backup, and lifecycle management."]})]})}function p(e={}){let{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,o.jsx)(s,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453(e,s,n){n.d(s,{R:()=>i,x:()=>c});var r=n(6540);let o={},t=r.createContext(o);function i(e){let s=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(t.Provider,{value:s},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.