├── .travis.yml
├── LICENSE.md
├── README.md
├── docker-compose.yml
├── examples
├── devel.yml
└── production.yml
├── odoo
├── Dockerfile
└── custom
│ ├── build.d
│ ├── 20-install-docker
│ ├── 80-odoo-symlink
│ └── 80-runbot-static-perms
│ ├── dependencies
│ ├── apt.txt
│ ├── apt_build.txt
│ └── pip.txt
│ ├── entrypoint.d
│ └── 30-login-docker
│ └── src
│ ├── addons.yaml
│ └── repos.yaml
└── traefik
├── Dockerfile
└── traefik.toml
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 |
3 | language: python
4 |
5 | services:
6 | - docker
7 |
8 | env:
9 | global:
10 | - BUILD_ARGS="ODOO_VERSION=9.0"
11 | - PORTS="8069:8069"
12 | - LINKS="db:db"
13 | - DOCKER_CONTEXT="./odoo"
14 | - LINT_IGNORE="DL3006" # @TODO: Remove when upstream tagged
15 |
16 | matrix:
17 | - TESTS="1"
18 | - LINT_CHECK="1"
19 |
20 | before_install:
21 | - docker run -d -e POSTGRES_USER="odoo" -e POSTGRES_PASSWORD="odoo" --name="db" postgres:9.6-alpine
22 |
23 | install:
24 | - git clone --depth=1 https://github.com/LasLabs/docker-quality-tools.git ${HOME}/docker-quality-tools
25 | - export PATH=${HOME}/docker-quality-tools/travis:${PATH}
26 | - travis_install_all
27 |
28 | script:
29 | - travis_run_all
30 |
31 | after_success:
32 | - travis_after_success_all
33 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Apache License
2 | ==============
3 |
4 | _Version 2.0, January 2004_
5 | _<>_
6 |
7 | ### Terms and Conditions for use, reproduction, and distribution
8 |
9 | #### 1. Definitions
10 |
11 | “License” shall mean the terms and conditions for use, reproduction, and
12 | distribution as defined by Sections 1 through 9 of this document.
13 |
14 | “Licensor” shall mean the copyright owner or entity authorized by the copyright
15 | owner that is granting the License.
16 |
17 | “Legal Entity” shall mean the union of the acting entity and all other entities
18 | that control, are controlled by, or are under common control with that entity.
19 | For the purposes of this definition, “control” means **(i)** the power, direct or
20 | indirect, to cause the direction or management of such entity, whether by
21 | contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
22 | outstanding shares, or **(iii)** beneficial ownership of such entity.
23 |
24 | “You” (or “Your”) shall mean an individual or Legal Entity exercising
25 | permissions granted by this License.
26 |
27 | “Source” form shall mean the preferred form for making modifications, including
28 | but not limited to software source code, documentation source, and configuration
29 | files.
30 |
31 | “Object” form shall mean any form resulting from mechanical transformation or
32 | translation of a Source form, including but not limited to compiled object code,
33 | generated documentation, and conversions to other media types.
34 |
35 | “Work” shall mean the work of authorship, whether in Source or Object form, made
36 | available under the License, as indicated by a copyright notice that is included
37 | in or attached to the work (an example is provided in the Appendix below).
38 |
39 | “Derivative Works” shall mean any work, whether in Source or Object form, that
40 | is based on (or derived from) the Work and for which the editorial revisions,
41 | annotations, elaborations, or other modifications represent, as a whole, an
42 | original work of authorship. For the purposes of this License, Derivative Works
43 | shall not include works that remain separable from, or merely link (or bind by
44 | name) to the interfaces of, the Work and Derivative Works thereof.
45 |
46 | “Contribution” shall mean any work of authorship, including the original version
47 | of the Work and any modifications or additions to that Work or Derivative Works
48 | thereof, that is intentionally submitted to Licensor for inclusion in the Work
49 | by the copyright owner or by an individual or Legal Entity authorized to submit
50 | on behalf of the copyright owner. For the purposes of this definition,
51 | “submitted” means any form of electronic, verbal, or written communication sent
52 | to the Licensor or its representatives, including but not limited to
53 | communication on electronic mailing lists, source code control systems, and
54 | issue tracking systems that are managed by, or on behalf of, the Licensor for
55 | the purpose of discussing and improving the Work, but excluding communication
56 | that is conspicuously marked or otherwise designated in writing by the copyright
57 | owner as “Not a Contribution.”
58 |
59 | “Contributor” shall mean Licensor and any individual or Legal Entity on behalf
60 | of whom a Contribution has been received by Licensor and subsequently
61 | incorporated within the Work.
62 |
63 | #### 2. Grant of Copyright License
64 |
65 | Subject to the terms and conditions of this License, each Contributor hereby
66 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
67 | irrevocable copyright license to reproduce, prepare Derivative Works of,
68 | publicly display, publicly perform, sublicense, and distribute the Work and such
69 | Derivative Works in Source or Object form.
70 |
71 | #### 3. Grant of Patent License
72 |
73 | Subject to the terms and conditions of this License, each Contributor hereby
74 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
75 | irrevocable (except as stated in this section) patent license to make, have
76 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where
77 | such license applies only to those patent claims licensable by such Contributor
78 | that are necessarily infringed by their Contribution(s) alone or by combination
79 | of their Contribution(s) with the Work to which such Contribution(s) was
80 | submitted. If You institute patent litigation against any entity (including a
81 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a
82 | Contribution incorporated within the Work constitutes direct or contributory
83 | patent infringement, then any patent licenses granted to You under this License
84 | for that Work shall terminate as of the date such litigation is filed.
85 |
86 | #### 4. Redistribution
87 |
88 | You may reproduce and distribute copies of the Work or Derivative Works thereof
89 | in any medium, with or without modifications, and in Source or Object form,
90 | provided that You meet the following conditions:
91 |
92 | * **(a)** You must give any other recipients of the Work or Derivative Works a copy of
93 | this License; and
94 | * **(b)** You must cause any modified files to carry prominent notices stating that You
95 | changed the files; and
96 | * **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
97 | all copyright, patent, trademark, and attribution notices from the Source form
98 | of the Work, excluding those notices that do not pertain to any part of the
99 | Derivative Works; and
100 | * **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
101 | Derivative Works that You distribute must include a readable copy of the
102 | attribution notices contained within such NOTICE file, excluding those notices
103 | that do not pertain to any part of the Derivative Works, in at least one of the
104 | following places: within a NOTICE text file distributed as part of the
105 | Derivative Works; within the Source form or documentation, if provided along
106 | with the Derivative Works; or, within a display generated by the Derivative
107 | Works, if and wherever such third-party notices normally appear. The contents of
108 | the NOTICE file are for informational purposes only and do not modify the
109 | License. You may add Your own attribution notices within Derivative Works that
110 | You distribute, alongside or as an addendum to the NOTICE text from the Work,
111 | provided that such additional attribution notices cannot be construed as
112 | modifying the License.
113 |
114 | You may add Your own copyright statement to Your modifications and may provide
115 | additional or different license terms and conditions for use, reproduction, or
116 | distribution of Your modifications, or for any such Derivative Works as a whole,
117 | provided Your use, reproduction, and distribution of the Work otherwise complies
118 | with the conditions stated in this License.
119 |
120 | #### 5. Submission of Contributions
121 |
122 | Unless You explicitly state otherwise, any Contribution intentionally submitted
123 | for inclusion in the Work by You to the Licensor shall be under the terms and
124 | conditions of this License, without any additional terms or conditions.
125 | Notwithstanding the above, nothing herein shall supersede or modify the terms of
126 | any separate license agreement you may have executed with Licensor regarding
127 | such Contributions.
128 |
129 | #### 6. Trademarks
130 |
131 | This License does not grant permission to use the trade names, trademarks,
132 | service marks, or product names of the Licensor, except as required for
133 | reasonable and customary use in describing the origin of the Work and
134 | reproducing the content of the NOTICE file.
135 |
136 | #### 7. Disclaimer of Warranty
137 |
138 | Unless required by applicable law or agreed to in writing, Licensor provides the
139 | Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
140 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
141 | including, without limitation, any warranties or conditions of TITLE,
142 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
143 | solely responsible for determining the appropriateness of using or
144 | redistributing the Work and assume any risks associated with Your exercise of
145 | permissions under this License.
146 |
147 | #### 8. Limitation of Liability
148 |
149 | In no event and under no legal theory, whether in tort (including negligence),
150 | contract, or otherwise, unless required by applicable law (such as deliberate
151 | and grossly negligent acts) or agreed to in writing, shall any Contributor be
152 | liable to You for damages, including any direct, indirect, special, incidental,
153 | or consequential damages of any character arising as a result of this License or
154 | out of the use or inability to use the Work (including but not limited to
155 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or
156 | any and all other commercial damages or losses), even if such Contributor has
157 | been advised of the possibility of such damages.
158 |
159 | #### 9. Accepting Warranty or Additional Liability
160 |
161 | While redistributing the Work or Derivative Works thereof, You may choose to
162 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or
163 | other liability obligations and/or rights consistent with this License. However,
164 | in accepting such obligations, You may act only on Your own behalf and on Your
165 | sole responsibility, not on behalf of any other Contributor, and only if You
166 | agree to indemnify, defend, and hold each Contributor harmless for any liability
167 | incurred by, or claims asserted against, such Contributor by reason of your
168 | accepting any such warranty or additional liability.
169 |
170 | _END OF TERMS AND CONDITIONS_
171 |
172 | ### APPENDIX: How to apply the Apache License to your work
173 |
174 | To apply the Apache License to your work, attach the following boilerplate
175 | notice, with the fields enclosed by brackets `[]` replaced with your own
176 | identifying information. (Don't include the brackets!) The text should be
177 | enclosed in the appropriate comment syntax for the file format. We also
178 | recommend that a file or class name and description of purpose be included on
179 | the same “printed page” as the copyright notice for easier identification within
180 | third-party archives.
181 |
182 | Copyright [yyyy] [name of copyright owner]
183 |
184 | Licensed under the Apache License, Version 2.0 (the "License");
185 | you may not use this file except in compliance with the License.
186 | You may obtain a copy of the License at
187 |
188 | http://www.apache.org/licenses/LICENSE-2.0
189 |
190 | Unless required by applicable law or agreed to in writing, software
191 | distributed under the License is distributed on an "AS IS" BASIS,
192 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193 | See the License for the specific language governing permissions and
194 | limitations under the License.
195 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://www.apache.org/licenses/LICENSE-2.0.html)
2 | [](https://travis-ci.org/LasLabs/docker-runbot)
3 |
4 | [](https://microbadger.com/images/laslabs/runbot "Get your own image badge on microbadger.com")
5 | [](https://microbadger.com/images/laslabs/runbot "Get your own version badge on microbadger.com")
6 |
7 | Docker Runbot
8 | =============
9 |
10 | This image provides a fully Dockerized Runbot environment.
11 |
12 | Usage
13 | =====
14 |
15 | Deploy
16 | ------
17 |
18 | The easiest way to deploy this image is by using Docker Compose.
19 |
20 | A simple compose file would look something like the below. This is a great one for testing Runbot locally:
21 |
22 | ```yml
23 | version: '2'
24 |
25 | volumes:
26 | odoo-db-data:
27 | driver: local
28 | odoo-web-data:
29 | driver: local
30 |
31 | services:
32 |
33 | web:
34 | image: laslabs/runbot:latest
35 | restart: unless-stopped
36 | links:
37 | - postgresql:db
38 | volumes:
39 | - odoo-web-data:/var/lib/odoo
40 | - /var/run/docker.sock:/var/run/docker.sock
41 | tty: true
42 | privileged: true
43 | ports:
44 | - 10080:8069
45 | - 1800-2000:1800-2000
46 |
47 | environment:
48 | PGPASSWORD: 'odoo'
49 | PGUSER: 'odoo'
50 | ADMIN_PASSWORD: 'admin'
51 |
52 | postgresql:
53 | image: postgres:9.6-alpine
54 | restart: unless-stopped
55 | environment:
56 | PGDATA: /var/lib/postgresql/data/pgdata
57 | POSTGRES_PASSWORD: 'odoo'
58 | POSTGRES_USER: 'odoo'
59 | volumes:
60 | - odoo-db-data:/var/lib/postgresql/data/pgdata
61 | ```
62 |
63 | In the above example, Runbot is being exposed on port 10080 with no load balancer.
64 | The default Runbot port ranges are also exposed (1800-2000).
65 |
66 | The following compose file can be used in order to launch Runbot behind a load balancer
67 | with a host rule for `localhost`. You will need to change it to a proper DNS name if not
68 | testing locally:
69 |
70 | ```yml
71 | version: '2'
72 |
73 | volumes:
74 | odoo-db-data:
75 | driver: local
76 | odoo-web-data:
77 | driver: local
78 |
79 | services:
80 |
81 | web:
82 | image: laslabs/runbot:latest
83 | restart: unless-stopped
84 | links:
85 | - postgresql:db
86 | volumes:
87 | - odoo-web-data:/var/lib/odoo
88 | - /var/run/docker.sock:/var/run/docker.sock
89 | tty: true
90 | privileged: true
91 | environment:
92 | PGPASSWORD: odoo
93 | PGUSER: odoo
94 | ADMIN_PASSWORD: admin
95 | labels:
96 | traefik.enable: 'true'
97 | traefik.port: '8069'
98 | traefik.frontend.rule: 'Host: localhost;'
99 |
100 | postgresql:
101 | image: postgres:9.6-alpine
102 | restart: unless-stopped
103 | environment:
104 | PGDATA: '/var/lib/postgresql/data/pgdata'
105 | POSTGRES_PASSWORD: 'odoo'
106 | POSTGRES_USER: 'odoo'
107 | volumes:
108 | - odoo-db-data:/var/lib/postgresql/data/pgdata
109 |
110 | traefik:
111 | image: laslabs/runbot-traefik:latest
112 | stdin_open: true
113 | volumes:
114 | - /var/run/docker.sock:/var/run/docker.sock
115 | tty: true
116 | ports:
117 | - 80:80
118 | - 8080:8080
119 | command:
120 | - --web
121 | ```
122 |
123 | In the above example, the load balancer is exposing Runbot and all of its builds on port 80.
124 | Port 8080 is the Traefik Web UI, which can be helpful for diagnosing issues.
125 |
126 | The following is what a production deploy would look like. Make sure to adjust the `traefik.frontend.rule`
127 | for your environment, as well as change all passwords:
128 |
129 | ```yml
130 | version: '2'
131 | volumes:
132 | odoo-web-data:
133 | driver: rancher-nfs
134 | odoo-db-data:
135 | driver: rancher-nfs
136 | runbot-builds:
137 | driver: rancher-nfs
138 | runbot-ssh:
139 | driver: rancher-nfs
140 | services:
141 | install:
142 | image: laslabs/runbot:latest
143 | command: 'install-addons'
144 | links:
145 | - postgresql:db
146 | volumes:
147 | - odoo-web-data:/var/lib/odoo
148 | - /var/run/docker.sock:/var/run/docker.sock
149 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
150 | - runbot-ssh:/home/odoo/.ssh
151 | tty: true
152 | environment:
153 | PGPASSWORD: odoo
154 | PGUSER: odoo
155 | WITHOUT_DEMO: all
156 | cron:
157 | privileged: true
158 | image: laslabs/runbot:latest
159 | environment:
160 | PGPASSWORD: odoo
161 | PGUSER: odoo
162 | WAIT_NOHOST: install
163 | volumes:
164 | - odoo-web-data:/var/lib/odoo
165 | - /var/run/docker.sock:/var/run/docker.sock
166 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
167 | - runbot-ssh:/home/odoo/.ssh
168 | tty: true
169 | links:
170 | - postgresql:db
171 | command:
172 | - /usr/local/bin/odoo
173 | - --max-cron-threads=1
174 | - --workers=1
175 | - --limit-time-real=600
176 | - --limit-time-cpu=300
177 | postgresql:
178 | image: postgres:9.6-alpine
179 | hostname: db
180 | environment:
181 | PGDATA: /var/lib/postgresql/data/pgdata
182 | POSTGRES_PASSWORD: odoo
183 | POSTGRES_USER: odoo
184 | volumes:
185 | - odoo-db-data:/var/lib/postgresql/data/pgdata
186 | web:
187 | image: laslabs/runbot:latest
188 | environment:
189 | ADMIN_PASSWORD: admin
190 | PGPASSWORD: odoo
191 | PGUSER: odoo
192 | PROXY_MODE: 'true'
193 | WAIT_NOHOST: install
194 | volumes:
195 | - odoo-web-data:/var/lib/odoo
196 | - /var/run/docker.sock:/var/run/docker.sock
197 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
198 | tty: true
199 | links:
200 | - postgresql:db
201 | ports:
202 | - 8069
203 | command:
204 | - /usr/local/bin/odoo
205 | - --max-cron-threads=0
206 | - --workers=4
207 | - --no-database-list
208 | - --db-filter=prod
209 | labels:
210 | traefik.enable: 'true'
211 | traefik.port: '8069'
212 | traefik.frontend.rule: 'Host: runbot.example.com;'
213 | traefik.frontend.passHostHeader: 'true'
214 | traefik:
215 | image: laslabs/runbot-traefik:latest
216 | stdin_open: true
217 | volumes:
218 | - /var/run/docker.sock:/var/run/docker.sock
219 | tty: true
220 | ports:
221 | - 80:80
222 | - 8080:8080
223 | command:
224 | - --web
225 | longpolling:
226 | image: laslabs/runbot:latest
227 | environment:
228 | PGPASSWORD: odoo
229 | PGUSER: odoo
230 | PROXY_MODE: 'true'
231 | WAIT_NOHOST: install
232 | volumes:
233 | - odoo-web-data:/var/lib/odoo
234 | - /var/run/docker.sock:/var/run/docker.sock
235 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
236 | tty: true
237 | links:
238 | - postgresql:db
239 | ports:
240 | - 8072
241 | command:
242 | - /usr/local/bin/odoo
243 | - --max-cron-threads=0
244 | - --workers=2
245 | labels:
246 | traefik.enable: 'true'
247 | traefik.port: '8072'
248 | traefik.frontend.rule: 'Host: localhost;PathPrefix:/longpolling'
249 | traefik.frontend.passHostHeader: 'true'
250 | ```
251 |
252 | The above compose is very similar to the production LasLabs one. It creates the
253 | following services:
254 |
255 | * `postgresql` - Database for the Runbot master
256 | * `traefik` - The almighty load balancer
257 | * `install` - Odoo instance that spawns before the other ones.
258 | Creates the initial database & installs initial addons, then shuts down.
259 | Can be discarded after initial use.
260 | * `web` - Web facing Runbot container
261 | * `longpolling` - Web facing Runbot longpolling container
262 | * `cron` - This is the Runbot cron worker, and actually performs the builds.
263 | Scale this for more build capacity.
264 |
265 | Docker Registries
266 | -----------------
267 |
268 | Sometimes logging into Docker registries can be required in order to allow
269 | custom Travis2Docker build images. In this case, the `DOCKER_REGISTRY_`
270 | environment variables have been exposed.
271 |
272 | The format of the docker registry variables is `DOCKER_REGISTRY_NAME_OPTION`
273 | where `NAME` is the canonical name for the Docker registry group, and `OPTION`
274 | is one of the following:
275 |
276 | * `HOSTNAME` - The hostname for the registry group. This is not required for
277 | Dockerhub.
278 | * `USERNAME` - The username for the registry group
279 | * `PASSWORD` - The password for the registry group
280 |
281 | Following is an example of two registries (`DOCKERHUB` and `EXAMPLE`):
282 |
283 | ```
284 | environment:
285 | DOCKER_REGISTRY_DOCKERHUB_USERNAME: "dockerhub_username"
286 | DOCKER_REGISTRY_DOCKERHUB_PASSWORD: "Sup3rS3cur3"
287 | DOCKER_REGISTRY_EXAMPLE_HOSTNAME: "registry.example.com:8080"
288 | DOCKER_REGISTRY_EXAMPLE_USERNAME: "example_registry_username"
289 | DOCKER_REGISTRY_EXAMPLE_PASSWORD: "apassword"
290 | ```
291 |
292 | Environment Variables
293 | =====================
294 |
295 | The following environment variables are available for configuration of the
296 | Runbot container:
297 |
298 | | Name | Default | Description |
299 | |------|---------|-------------|
300 | | `ADMIN_PASSWORD` | admin | Password for the Runbot database manager |
301 | | `UNACCENT` | true | Search without accented characters |
302 | | `PGUSER` | odoo | Username to database |
303 | | `PGPASSWORD` | odoopassword | Password for the database |
304 | | `PGHOST` | db | Hostname for the database server |
305 | | `PGDATABASE` | prod | Database name to use for Runbot|
306 | | `PROXY_MODE` | false | Set to `true` if Runbot is behind a load balancer |
307 | | `WITHOUT_DEMO` | all | Demo data setting for Runbot |
308 | | `DOCKER_REGISTRY_X_USERNAME` | | Username for logging into registry group X |
309 | | `DOCKER_REGISTRY_X_PASSWORD` | | Password for logging into registry group X |
310 | | `DOCKER_REGISTRY_X_HOSTNAME` | | Hostname for registry group X. Not required for DockerHub |
311 |
312 |
313 | Known Issues / Roadmap
314 | ======================
315 |
316 | *
317 |
318 | Bug Tracker
319 | ===========
320 |
321 | Bugs are tracked on [GitHub Issues](https://github.com/LasLabs/docker-runbot/issues).
322 | In case of trouble, please check there to see if your issue has already been reported.
323 | If you spotted it first, help us smash it by providing detailed and welcomed feedback.
324 |
325 | Credits
326 | =======
327 |
328 | Contributors
329 | ------------
330 |
331 | * Dave Lasley
332 |
333 | Maintainer
334 | ----------
335 |
336 | [](https://laslabs.com)
337 |
338 | This module is maintained by [LasLabs Inc.](https://laslabs.com)
339 |
340 | * https://github.com/LasLabs/docker-runbot
341 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "2.1"
2 |
3 | services:
4 | odoo:
5 | image: laslabs/runbot:9.0
6 | build:
7 | context: ./odoo
8 | args:
9 | ODOO_VERSION: 9.0
10 | environment:
11 | ODOO_MAJOR: 9
12 | ODOO_MINOR: 9.0
13 | DEPTH_DEFAULT: 1
14 |
--------------------------------------------------------------------------------
/examples/devel.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | services:
4 |
5 | web:
6 | image: laslabs/runbot:9.0
7 | restart: unless-stopped
8 | links:
9 | - postgresql:db
10 | volumes:
11 | - odoo-web-data:/var/lib/odoo
12 | - /var/run/docker.sock:/var/run/docker.sock
13 | tty: true
14 | privileged: true
15 | ports:
16 | - 10080:8069
17 | - 1800-2000:1800-2000
18 |
19 | environment:
20 | PGPASSWORD: 'odoo'
21 | PGUSER: 'odoo'
22 | ADMIN_PASSWORD: 'admin'
23 |
24 | postgresql:
25 | image: postgres:9.6-alpine
26 | restart: unless-stopped
27 | environment:
28 | PGDATA: /var/lib/postgresql/data/pgdata
29 | POSTGRES_PASSWORD: 'odoo'
30 | POSTGRES_USER: 'odoo'
31 | volumes:
32 | - odoo-db-data:/var/lib/postgresql/data/pgdata
33 |
--------------------------------------------------------------------------------
/examples/production.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 | volumes:
3 | odoo-web-data:
4 | driver: aufs
5 | odoo-db-data:
6 | driver: aufs
7 | runbot-builds:
8 | driver: aufs
9 | runbot-ssh:
10 | driver: aufs
11 | services:
12 | install:
13 | image: laslabs/runbot:9.0
14 | command: 'install-addons'
15 | links:
16 | - postgresql:db
17 | volumes:
18 | - odoo-web-data:/var/lib/odoo
19 | - /var/run/docker.sock:/var/run/docker.sock
20 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
21 | - runbot-ssh:/home/odoo/.ssh
22 | tty: true
23 | environment:
24 | PGPASSWORD: odoo
25 | PGUSER: odoo
26 | WITHOUT_DEMO: all
27 | cron:
28 | privileged: true
29 | image: laslabs/runbot:9.0
30 | environment:
31 | PGPASSWORD: odoo
32 | PGUSER: odoo
33 | WAIT_NOHOST: install
34 | volumes:
35 | - odoo-web-data:/var/lib/odoo
36 | - /var/run/docker.sock:/var/run/docker.sock
37 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
38 | - runbot-ssh:/home/odoo/.ssh
39 | tty: true
40 | links:
41 | - postgresql:db
42 | command:
43 | - /usr/local/bin/odoo
44 | - --max-cron-threads=1
45 | - --workers=1
46 | - --limit-time-real=600
47 | - --limit-time-cpu=300
48 | postgresql:
49 | image: postgres:9.6-alpine
50 | hostname: db
51 | environment:
52 | PGDATA: /var/lib/postgresql/data/pgdata
53 | POSTGRES_PASSWORD: odoo
54 | POSTGRES_USER: odoo
55 | volumes:
56 | - odoo-db-data:/var/lib/postgresql/data/pgdata
57 | web:
58 | image: laslabs/runbot:9.0
59 | environment:
60 | ADMIN_PASSWORD: admin
61 | PGPASSWORD: odoo
62 | PGUSER: odoo
63 | PROXY_MODE: 'true'
64 | WAIT_NOHOST: install
65 | volumes:
66 | - odoo-web-data:/var/lib/odoo
67 | - /var/run/docker.sock:/var/run/docker.sock
68 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
69 | tty: true
70 | links:
71 | - postgresql:db
72 | ports:
73 | - 8069
74 | command:
75 | - /usr/local/bin/odoo
76 | - --max-cron-threads=0
77 | - --workers=4
78 | - --no-database-list
79 | - --db-filter=prod
80 | labels:
81 | traefik.enable: 'true'
82 | traefik.port: '8069'
83 | traefik.frontend.rule: 'Host: runbot.example.com;'
84 | traefik.frontend.passHostHeader: 'true'
85 | traefik:
86 | image: laslabs/runbot-traefik:latest
87 | stdin_open: true
88 | volumes:
89 | - /var/run/docker.sock:/var/run/docker.sock
90 | tty: true
91 | ports:
92 | - 80:80
93 | - 8080:8080
94 | command:
95 | - --web
96 | longpolling:
97 | image: laslabs/runbot:9.0
98 | environment:
99 | PGPASSWORD: odoo
100 | PGUSER: odoo
101 | PROXY_MODE: 'true'
102 | WAIT_NOHOST: install
103 | volumes:
104 | - odoo-web-data:/var/lib/odoo
105 | - /var/run/docker.sock:/var/run/docker.sock
106 | - runbot-builds:/opt/odoo/custom/src/odoo-extra/runbot/static
107 | tty: true
108 | links:
109 | - postgresql:db
110 | ports:
111 | - 8072
112 | command:
113 | - /usr/local/bin/odoo
114 | - --max-cron-threads=0
115 | - --workers=2
116 | labels:
117 | traefik.enable: 'true'
118 | traefik.port: '8072'
119 | traefik.frontend.rule: 'Host: localhost;PathPrefix:/longpolling'
120 | traefik.frontend.passHostHeader: 'true'
121 |
--------------------------------------------------------------------------------
/odoo/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM lasley/docker-odoo-base
2 | MAINTAINER LasLabs Inc
3 |
4 | VOLUME /home/odoo/.ssh
5 |
6 | # Metadata
7 | ARG BUILD_DATE
8 | ARG VCS_REF
9 | ARG VERSION
10 | LABEL org.label-schema.build-date=$BUILD_DATE \
11 | org.label-schema.name="LasLabs.com Runbot v9" \
12 | org.label-schema.description="Provides a Dockerized Runbot." \
13 | org.label-schema.url="https://laslabs.com/" \
14 | org.label-schema.vcs-ref=$VCS_REF \
15 | org.label-schema.vcs-url="https://github.com/LasLabs/docker-runbot" \
16 | org.label-schema.vendor="LasLabs Inc." \
17 | org.label-schema.version=$VERSION \
18 | org.label-schema.schema-version="1.0"
19 |
--------------------------------------------------------------------------------
/odoo/custom/build.d/20-install-docker:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | apt-get update
5 |
6 | apt-get install -y \
7 | apt-transport-https \
8 | ca-certificates \
9 | curl \
10 | gnupg2 \
11 | software-properties-common
12 |
13 | curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
14 |
15 | add-apt-repository \
16 | "deb [arch=amd64] https://download.docker.com/linux/debian \
17 | $(lsb_release -cs) \
18 | stable"
19 |
20 | apt-get update
21 |
22 | apt-get install -y docker-ce
23 |
24 | usermod -a -G docker odoo
25 |
26 | apt-get purge -y curl \
27 | gnupg2 \
28 | software-properties-common
29 |
--------------------------------------------------------------------------------
/odoo/custom/build.d/80-odoo-symlink:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 | src=/opt/odoo/custom/src/odoo
4 | dst=/usr/local/bin/odoo
5 |
6 | ln -s $dst.py $dst
7 |
--------------------------------------------------------------------------------
/odoo/custom/build.d/80-runbot-static-perms:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | chown odoo: -R /opt/odoo/custom/src/odoo-extra/runbot/static/
4 |
--------------------------------------------------------------------------------
/odoo/custom/dependencies/apt.txt:
--------------------------------------------------------------------------------
1 | font-manager
2 | libssl-dev
3 | python-matplotlib
4 |
--------------------------------------------------------------------------------
/odoo/custom/dependencies/apt_build.txt:
--------------------------------------------------------------------------------
1 | build-essential
2 | python-dev
--------------------------------------------------------------------------------
/odoo/custom/dependencies/pip.txt:
--------------------------------------------------------------------------------
1 | simplejson
--------------------------------------------------------------------------------
/odoo/custom/entrypoint.d/30-login-docker:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import logging
4 | import os
5 | import subprocess
6 |
7 | from collections import defaultdict
8 |
9 | PREFIX = 'DOCKER_REGISTRY_'
10 |
11 | registries = defaultdict(dict)
12 |
13 | # Get registry information from env vars
14 | for name, value in os.environ.items():
15 |
16 | if not name.startswith(PREFIX):
17 | continue
18 |
19 | name = name.replace(PREFIX, '')
20 | registry, option = name.rsplit('_', 1)
21 | registries[registry][option] = value.strip()
22 |
23 | # Iterate and login
24 | for registry, options in registries.items():
25 |
26 | try:
27 | command = [
28 | 'docker', 'login',
29 | '--username="%s"' % options['USERNAME'],
30 | '--password="%s"' % options['PASSWORD'].replace('$', '$$'),
31 | ]
32 | try:
33 | command.append(options['HOSTNAME'])
34 | except KeyError:
35 | pass
36 | subprocess.check_output(command)
37 | except (subprocess.CalledProcessError, KeyError):
38 | logging.exception('Could not login to registry with "%s"', options)
39 |
--------------------------------------------------------------------------------
/odoo/custom/src/addons.yaml:
--------------------------------------------------------------------------------
1 | partner-contact:
2 | - "*"
3 |
4 | product-attribute:
5 | - "*"
6 |
7 | server-tools:
8 | - "*"
9 |
10 | web:
11 | - web_responsive
12 | - "*"
13 |
14 | website:
15 | - "*"
16 |
17 | social:
18 | - "*"
19 |
20 | odoo-extra:
21 | - runbot
22 | - "*"
23 |
24 | runbot-addons:
25 | - runbot_traefik
26 | - runbot_travis2docker
27 | - "*"
28 |
--------------------------------------------------------------------------------
/odoo/custom/src/repos.yaml:
--------------------------------------------------------------------------------
1 | # Odoo is always required
2 | ./odoo:
3 | defaults:
4 | # Shallow repositories (1=1) are faster & thinner
5 | # You may need a bigger depth when merging PRs
6 | depth: "$DEPTH_DEFAULT"
7 | remotes:
8 | ocb: https://github.com/OCA/OCB.git
9 | odoo: https://github.com/odoo/odoo.git
10 | target:
11 | ocb 9.0
12 | merges:
13 | - ocb 9.0
14 | # Example of a merge of the PR with the number
15 | # - oca refs/pull//head
16 |
17 | ./odoo-extra:
18 | defaults:
19 | depth: "$DEPTH_DEFAULT"
20 | remotes:
21 | odoo: https://github.com/odoo/odoo-extra.git
22 | vauxoo: https://github.com/vauxoo/odoo-extra.git
23 | target:
24 | odoo aggregated_branch_name
25 | merges:
26 | - vauxoo 9.0
27 |
28 | ./runbot-addons:
29 | defaults:
30 | depth: "$DEPTH_DEFAULT"
31 | remotes:
32 | oca: https://github.com/OCA/runbot-addons.git
33 | laslabs: https://github.com/LasLabs/runbot-addons.git
34 | target:
35 | laslabs aggregated_branch_name
36 | merges:
37 | - laslabs long-term/runbot
38 |
39 | ./server-tools:
40 | defaults:
41 | depth: "$DEPTH_DEFAULT"
42 | remotes:
43 | oca: https://github.com/OCA/server-tools.git
44 | laslabs: https://github.com/LasLabs/server-tools.git
45 | target:
46 | laslabs aggregated_branch_name
47 | merges:
48 | - oca 9.0
49 |
50 | ./web:
51 | defaults:
52 | depth: "$DEPTH_DEFAULT"
53 | remotes:
54 | oca: https://github.com/OCA/web.git
55 | laslabs: https://github.com/LasLabs/web.git
56 | merges:
57 | - oca 9.0
58 | target: laslabs aggregated_branch_name
59 |
60 | ./website:
61 | defaults:
62 | depth: "$DEPTH_DEFAULT"
63 | remotes:
64 | oca: https://github.com/OCA/website.git
65 | laslabs: https://github.com/LasLabs/website.git
66 | merges:
67 | - oca 9.0
68 | target: oca 9.0
69 |
70 | ./social:
71 | defaults:
72 | depth: "$DEPTH_DEFAULT"
73 | remotes:
74 | oca: https://github.com/OCA/social.git
75 | laslabs: https://github.com/LasLabs/social.git
76 | merges:
77 | - oca 9.0
78 | target:
79 | laslabs aggregated_branch_name
80 |
--------------------------------------------------------------------------------
/traefik/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM traefik:1.3-alpine
2 | MAINTAINER LasLabs Inc
3 |
4 | COPY ./traefik.toml /etc/traefik/traefik.toml
5 |
6 | VOLUME /opt/traefik/certs/
7 |
8 | # Metadata
9 | ARG BUILD_DATE
10 | ARG VCS_REF
11 | ARG VERSION
12 | LABEL org.label-schema.build-date=$BUILD_DATE \
13 | org.label-schema.name="LasLabs.com Runbot Traefik" \
14 | org.label-schema.description="Provides a Traefik Load Balancer for Runbot in Docker." \
15 | org.label-schema.url="https://laslabs.com/" \
16 | org.label-schema.vcs-ref=$VCS_REF \
17 | org.label-schema.vcs-url="https://github.com/LasLabs/docker-runbot" \
18 | org.label-schema.vendor="LasLabs Inc." \
19 | org.label-schema.version=$VERSION \
20 | org.label-schema.schema-version="1.0"
21 |
--------------------------------------------------------------------------------
/traefik/traefik.toml:
--------------------------------------------------------------------------------
1 | ################################################################
2 | # Globals
3 | ################################################################
4 |
5 | defaultEntryPoints = ["http"]
6 |
7 | ################################################################
8 | # Entrypoints
9 | ################################################################
10 |
11 | [entryPoints]
12 | [entryPoints.http]
13 | address = ":80"
14 |
15 | ################################################################
16 | # Docker configuration backend
17 | ################################################################
18 | [docker]
19 | watch = true
20 | exposedbydefault = false
21 |
--------------------------------------------------------------------------------