Skip to content

Commit 9e33447

Browse files
authored
Initial commit
0 parents  commit 9e33447

File tree

12 files changed

+876
-0
lines changed

12 files changed

+876
-0
lines changed

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
POSTGRES_USER=odoo
2+
POSTGRES_PASSWORD=odoo
3+
4+
ODOO_DB_HOST=app_odoo_db
5+
ODOO_DB_USER=odoo
6+
ODOO_DB_PASSWORD=odoo
7+
ODOO_DB_PORT=5432
8+
9+
# Optional, if you have a specific database
10+
# ODOO_DB_NAME=app_odoo
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Docker
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
target_platforms:
7+
description: "Target platforms for buildx (e.g., linux/amd64,linux/arm64)"
8+
required: false
9+
default: "linux/amd64"
10+
skip_unit_tests:
11+
description: "Skip unit tests when building this image"
12+
type: boolean
13+
default: true
14+
schedule:
15+
- cron: "38 3 * * *"
16+
push:
17+
branches:
18+
- master
19+
paths-ignore:
20+
- "README.md"
21+
22+
env:
23+
DESTINATION_REGISTRY: ghcr.io
24+
DESTINATION_IMAGE_NAME: ${{ github.repository }}
25+
DESTINATION_REGISTRY_USERNAME: ${{ secrets.DESTINATION_REGISTRY_USERNAME || github.actor }}
26+
DESTINATION_REGISTRY_PASSWORD: ${{ secrets.DESTINATION_REGISTRY_PASSWORD || secrets.GITHUB_TOKEN }}
27+
28+
ODOO_BASE_IMAGE: ghcr.io/adomi-io/odoo:19.0
29+
30+
jobs:
31+
build-and-push:
32+
runs-on: ubuntu-latest
33+
34+
concurrency:
35+
group: docker-${{ github.workflow }}-${{ github.ref }}
36+
cancel-in-progress: true
37+
38+
permissions:
39+
contents: read
40+
packages: write
41+
42+
env:
43+
TARGET_PLATFORMS: ${{ github.event_name == 'workflow_dispatch' && inputs.target_platforms || 'linux/amd64' }}
44+
SKIP_UNIT_TESTS: ${{ github.event_name == 'workflow_dispatch' && inputs.skip_unit_tests || false }}
45+
IS_MASTER: ${{ github.ref_name == 'master' }}
46+
IMAGE_TAG: ${{ github.ref_name }}
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v4
51+
52+
- name: Set up QEMU
53+
uses: docker/setup-qemu-action@v3
54+
55+
- name: Set up Docker Buildx
56+
uses: docker/setup-buildx-action@v3
57+
58+
- name: Build Docker image for testing
59+
if: ${{ !env.SKIP_UNIT_TESTS }}
60+
uses: docker/build-push-action@v5
61+
with:
62+
build-args: |
63+
ODOO_BASE_IMAGE=${{ env.ODOO_BASE_IMAGE }}
64+
tags: ${{ env.DESTINATION_REGISTRY }}/${{ env.DESTINATION_IMAGE_NAME }}:${{ env.IMAGE_TAG }}-test
65+
push: false
66+
load: true
67+
68+
- name: Run unit tests
69+
if: ${{ !env.SKIP_UNIT_TESTS }}
70+
working-directory: tests
71+
run: ./unit-tests.sh
72+
env:
73+
TESTS_IMAGE_TAG: ${{ env.DESTINATION_REGISTRY }}/${{ env.DESTINATION_IMAGE_NAME }}:${{ env.IMAGE_TAG }}-test
74+
SKIP_BUILD: true
75+
76+
- name: Log into destination registry
77+
if: github.event_name != 'pull_request'
78+
uses: docker/login-action@v3
79+
with:
80+
registry: ${{ env.DESTINATION_REGISTRY }}
81+
username: ${{ env.DESTINATION_REGISTRY_USERNAME }}
82+
password: ${{ env.DESTINATION_REGISTRY_PASSWORD }}
83+
84+
- name: Extract Docker metadata
85+
if: github.event_name != 'pull_request'
86+
id: meta
87+
uses: docker/metadata-action@v5
88+
with:
89+
images: ${{ env.DESTINATION_REGISTRY }}/${{ env.DESTINATION_IMAGE_NAME }}
90+
tags: |
91+
# Tag by ref (master) or explicit override from workflow_dispatch
92+
type=raw,value=${{ env.IMAGE_TAG }}
93+
# Add short sha tag for traceability
94+
type=sha,format=short
95+
# Add latest only on master
96+
type=raw,value=latest,enable=${{ env.IS_MASTER == 'true' }}
97+
98+
- name: Build and push multi-arch Docker image
99+
if: github.event_name != 'pull_request'
100+
uses: docker/build-push-action@v5
101+
with:
102+
platforms: ${{ env.TARGET_PLATFORMS }}
103+
build-args: |
104+
ODOO_BASE_IMAGE=${{ env.ODOO_BASE_IMAGE }}
105+
tags: ${{ steps.meta.outputs.tags }}
106+
labels: ${{ steps.meta.outputs.labels }}
107+
push: true

.gitignore

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# === Python ===
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# Installer logs
31+
pip-log.txt
32+
pip-delete-this-directory.txt
33+
34+
# Unit test / coverage reports
35+
htmlcov/
36+
.tox/
37+
.nox/
38+
.coverage
39+
.coverage.*
40+
.cache
41+
nosetests.xml
42+
coverage.xml
43+
*.cover
44+
*.pyo
45+
.hypothesis/
46+
.pytest_cache/
47+
cover/
48+
49+
# Translations
50+
*.mo
51+
*.pot
52+
53+
# Environments
54+
.env*
55+
!.env.example
56+
57+
# mypy
58+
.mypy_cache/
59+
.dmypy.json
60+
dmypy.json
61+
62+
# PyCharm
63+
# JetBrains specific template is handled below, but adding common ones here.
64+
.idea/
65+
66+
# === Odoo ===
67+
# Odoo data and logs
68+
# These directories are often used for Odoo's file storage and sessions
69+
/data/
70+
*.log
71+
72+
# Odoo configuration
73+
# Usually odoo.conf is kept in the repo as a template, but sensitive info
74+
# should be provided via environment variables (.env file)
75+
# config/odoo.conf
76+
77+
# === Docker ===
78+
.docker/
79+
80+
# Ignore any docker-compose override files that might contain local development tweaks
81+
docker-compose.override.yml
82+
83+
# === OS Files ===
84+
# macOS
85+
.DS_Store
86+
.AppleDouble
87+
.LSOverride
88+
89+
# Icon must end with two \r
90+
Icon
91+
92+
# Thumbnails
93+
._*
94+
95+
# Files that might appear in the root of a volume mount
96+
.DocumentRevisions-V100
97+
.fseventsd
98+
.Spotlight-V100
99+
.TemporaryItems
100+
.Trashes
101+
.VolumeIcon.icns
102+
.com.apple.timemachine.donotpresent
103+
104+
# Directories potentially created on remote AFP share
105+
.AppleDB
106+
.AppleDesktop
107+
Network Trash Folder
108+
Temporary Items
109+
.apdisk
110+
111+
# Windows
112+
Thumbs.db
113+
Thumbs.db:encryptable
114+
ehthumbs.db
115+
ehthumbs_vista.db
116+
117+
*.stackdump
118+
119+
[Dd]esktop.ini
120+
121+
# Recycle Bin used on FAT drives
122+
$RECYCLE.BIN/
123+
124+
# Windows Installer logs
125+
*.cab
126+
*.msi
127+
*.msix
128+
*.msm
129+
*.msp
130+
131+
# Windows shortcuts
132+
*.lnk
133+
134+
# === IDEs ===
135+
# Visual Studio Code
136+
.vscode/
137+
!.vscode/settings.json
138+
!.vscode/tasks.json
139+
!.vscode/launch.json
140+
!.vscode/extensions.json
141+
*.code-workspace
142+
143+
# Vim
144+
[._]*.s[a-v][a-z]
145+
[._]sw[a-p]
146+
[._]s[a-rt-z]
147+
[._]ss
148+
*.un~
149+
Session.vim
150+
.netrwhist

Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is the docker image we want to use as a base image
2+
# If you have your own image, update the package url here
3+
# By default, we will use the Adomi Odoo upstream image
4+
#
5+
# You can find the source code here:
6+
# https://github.com/adomi-io/odoo
7+
8+
ARG ODOO_BASE_IMAGE=ghcr.io/adomi-io/odoo:19.0
9+
10+
11+
FROM ${ODOO_BASE_IMAGE} AS configuration_layer
12+
13+
# Set user to root so we can install dependencies
14+
USER root
15+
16+
# Here, you can install python dependencies
17+
# For example:
18+
# RUN pip install \
19+
# python-slugify \
20+
# stripe \
21+
# mailerlite \
22+
# mailerlite \
23+
# pika \
24+
# betterproto \
25+
# typeform \
26+
# meilisearch
27+
28+
# Extend the layer with our python dependencies installed
29+
FROM configuration_layer
30+
31+
# Odoo will run as a non-root user
32+
# UID 1000 is the default user for Ubuntu
33+
USER 1000
34+
35+
# We will work in the volumes directory, where our addons
36+
# and mounted files are located
37+
WORKDIR /volumes
38+
39+
# Copy your configuration into the container
40+
COPY config/odoo.conf /volumes/config/odoo.conf
41+
42+
# Copy extra addons for downstream images
43+
COPY extra_addons /volumes/extra_addons
44+
45+
# Copy your custom addons into the container
46+
COPY addons /volumes/addons

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2026 Adomi Software, LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)