mirror of
https://github.com/odoocker/odoocker
synced 2025-11-04 23:29:19 +01:00
Compare commits
81 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53f235a619 | ||
|
|
4f1132afef | ||
|
|
faa6cf6b4c | ||
|
|
7568dbc44f | ||
|
|
77edc03b91 | ||
|
|
6fd07e113a | ||
|
|
bf51474d47 | ||
|
|
137e653d7f | ||
|
|
f2be28ff3e | ||
|
|
f9a6d5c1ab | ||
|
|
d3e819b4b6 | ||
|
|
1a191383fa | ||
|
|
f29066cc16 | ||
|
|
649c51cc9c | ||
|
|
ecac58a89e | ||
|
|
c677cdd69e | ||
|
|
fa93ecd4f4 | ||
|
|
2076c8ddfa | ||
|
|
98b94b6f86 | ||
|
|
eaa7826e4b | ||
|
|
3127152a17 | ||
|
|
c371f6048e | ||
|
|
eaab5db2cb | ||
|
|
78380ad296 | ||
|
|
f83c8aed1c | ||
|
|
0c2b41aed3 | ||
|
|
cd3bd7ee83 | ||
|
|
bd65372798 | ||
|
|
7d2de6e31f | ||
|
|
10a9bcc70c | ||
|
|
a4823e8fcc | ||
|
|
3cd2a13244 | ||
|
|
59eb85669c | ||
|
|
84dcb0b8a4 | ||
|
|
e01d746b2a | ||
|
|
f956cabf57 | ||
|
|
449ba2ae07 | ||
|
|
5e21d9e76e | ||
|
|
d961bb291e | ||
|
|
2a1ac8a17f | ||
|
|
10f3aa0302 | ||
|
|
e26bd85abc | ||
|
|
284dc69588 | ||
|
|
c3f70d3a99 | ||
|
|
986fffafc3 | ||
|
|
70fc974b62 | ||
|
|
688a590282 | ||
|
|
ca55f3d0d0 | ||
|
|
8a1844cfa1 | ||
|
|
53ee5f8565 | ||
|
|
106dff0207 | ||
|
|
3595ed42cb | ||
|
|
1e11d3fb37 | ||
|
|
48cb2c06cb | ||
|
|
af83a19fa4 | ||
|
|
2bbaa84714 | ||
|
|
d85b660a44 | ||
|
|
85a1928677 | ||
|
|
554f9f533d | ||
|
|
0cd36b92a3 | ||
|
|
d0ec5118eb | ||
|
|
55270202ab | ||
|
|
007ffc441c | ||
|
|
5a1a268395 | ||
|
|
a2219d371b | ||
|
|
ae92bbb36a | ||
|
|
22c1be3e40 | ||
|
|
e6fa71769f | ||
|
|
36a2d5d0ca | ||
|
|
cef72366c2 | ||
|
|
4255e2f1cc | ||
|
|
6176399594 | ||
|
|
fc0d0c9875 | ||
|
|
dddafd862f | ||
|
|
7b3b84fbdb | ||
|
|
187f18440e | ||
|
|
072a1d6f3c | ||
|
|
1cb579cd36 | ||
|
|
9bd6a608a3 | ||
|
|
ce2bef1bdc | ||
|
|
e1dcc69b5b |
264
.env.example
264
.env.example
@@ -6,19 +6,35 @@ APP_ENV=local
|
|||||||
INIT=
|
INIT=
|
||||||
UPDATE=
|
UPDATE=
|
||||||
LOAD=base,web
|
LOAD=base,web
|
||||||
WORKERS=2
|
ROOT_PATH=/usr/lib/python3/dist-packages/odoo
|
||||||
DEV_MODE=reload,qweb
|
WORKERS=0
|
||||||
DOMAIN=erp.odoocker.test
|
DOMAIN=erp.odoocker.test
|
||||||
|
ADMIN_PASSWD=odoo
|
||||||
|
# Use reload,xml to enable hot reload in python and xml files
|
||||||
|
DEV_MODE=
|
||||||
|
|
||||||
# Enterprise
|
# Services
|
||||||
|
PROJECT_NAME=odoocker
|
||||||
|
SERVICES=odoo,nginx,proxy,postgres
|
||||||
|
|
||||||
|
# Service configuration
|
||||||
|
USE_REDIS=false
|
||||||
|
USE_S3=false
|
||||||
|
USE_SENTRY=false
|
||||||
|
USE_PGADMIN=false
|
||||||
|
|
||||||
|
# GitHub user and access token to clone private repositories
|
||||||
GITHUB_USER=
|
GITHUB_USER=
|
||||||
GITHUB_ACCESS_TOKEN=
|
GITHUB_ACCESS_TOKEN=
|
||||||
|
|
||||||
|
# GitHub user and access token to clone Enterprise repository
|
||||||
|
ENTERPRISE_USER=${GITHUB_USER}
|
||||||
|
ENTERPRISE_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN}
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
ADMIN_PASSWD=odoo
|
|
||||||
DB_HOST=postgres
|
DB_HOST=postgres
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
DB_NAME=odoo
|
DB_NAME=
|
||||||
DB_USER=odoo
|
DB_USER=odoo
|
||||||
DB_PASSWORD=odoo
|
DB_PASSWORD=odoo
|
||||||
LOAD_LANGUAGE=
|
LOAD_LANGUAGE=
|
||||||
@@ -26,14 +42,24 @@ LOAD_LANGUAGE=
|
|||||||
DB_SSLMODE=prefer
|
DB_SSLMODE=prefer
|
||||||
DB_MAXCONN=64
|
DB_MAXCONN=64
|
||||||
DB_TEMPLATE=unaccent_template
|
DB_TEMPLATE=unaccent_template
|
||||||
UNACCENT=True
|
UNACCENT=False
|
||||||
LIST_DB=True
|
LIST_DB=True
|
||||||
DBFILTER=.*
|
DBFILTER=.*
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
LOG_LEVEL=debug
|
LOG_LEVEL=info
|
||||||
# Additional logs
|
# Additional logs
|
||||||
LOG_HANDLER_LEVEL=INFO
|
LOG_HANDLER_LEVEL=INFO
|
||||||
|
# Sentry
|
||||||
|
SENTRY_DSN=
|
||||||
|
SENTRY_ENABLED=true
|
||||||
|
SENTRY_LOGGING_LEVEL=warn
|
||||||
|
SENTRY_EXCLUDE_LOGGERS=
|
||||||
|
SENTRY_IGNORE_EXCEPTIONS=
|
||||||
|
SENTRY_INCLUDE_CONTEXT=true
|
||||||
|
SENTRY_ENVIRONMENT=production
|
||||||
|
SENTRY_RELEASE=
|
||||||
|
SENTRY_ODOO_DIR=${ROOT_PATH}
|
||||||
|
|
||||||
# Nginx
|
# Nginx
|
||||||
CORS_ALLOWED_DOMAIN="'http://external-domain.test'"
|
CORS_ALLOWED_DOMAIN="'http://external-domain.test'"
|
||||||
@@ -52,24 +78,95 @@ SMTP_PASSWORD=
|
|||||||
EMAIL_FROM=
|
EMAIL_FROM=
|
||||||
FROM_FILTER=
|
FROM_FILTER=
|
||||||
|
|
||||||
|
# Postgres
|
||||||
|
POSTGRES_MAIN_HOST=${DB_HOST}
|
||||||
|
POSTGRES_MAIN_PORT=${DB_PORT}
|
||||||
|
POSTGRES_MAIN_DB=postgres
|
||||||
|
POSTGRES_MAIN_USER=postgres
|
||||||
|
POSTGRES_MAIN_PASSWORD=${DB_PASSWORD}
|
||||||
|
|
||||||
|
# Redis
|
||||||
|
SESSION_REDIS=true
|
||||||
|
REDIS_HOST=redis
|
||||||
|
REDIS_PORT=6379
|
||||||
|
REDIS_PASSWORD=
|
||||||
|
REDIS_URL=
|
||||||
|
REDIS_PREFIX=${PROJECT_NAME}
|
||||||
|
REDIS_SENTINEL_MASTER_NAME=
|
||||||
|
REDIS_SENTINEL_HOST=
|
||||||
|
REDIS_SENTINEL_PORT=26379
|
||||||
|
REDIS_EXPIRATION=604800
|
||||||
|
REDIS_EXPIRATION_ANONYMOUS=10800
|
||||||
|
|
||||||
|
# Filesystem
|
||||||
|
S3_VIRTUAL_HOST=s3.odoocker.test
|
||||||
|
S3_API_PORT=9000
|
||||||
|
S3_CONSOLE_PORT=9001
|
||||||
|
|
||||||
|
AWS_HOST=http://s3:${S3_API_PORT}
|
||||||
|
AWS_REGION=
|
||||||
|
AWS_ACCESS_KEY_ID=myaccesskey
|
||||||
|
AWS_SECRET_ACCESS_KEY=mysecretkey
|
||||||
|
AWS_BUCKETNAME=${PROJECT_NAME}-{db}
|
||||||
|
|
||||||
# PgAdmin
|
# PgAdmin
|
||||||
PGADMIN_DOMAIN=pgadmin.odoocker.test
|
PGADMIN_DOMAIN=pgadmin.odoocker.test
|
||||||
PGADMIN_PASSWORD=odoo
|
PGADMING_DB_NAME=pgadmin
|
||||||
|
PGADMING_DB_USER=pgadmin
|
||||||
|
PGADMIN_DB_PASSWORD=${DB_PASSWORD}
|
||||||
|
PGADMIN_DB_HOST="'postgresql://${PGADMING_DB_USER}:${PGADMIN_DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${PGADMING_DB_NAME}'"
|
||||||
|
|
||||||
|
PGADMIN_EMAIL=pgadmin@example.com
|
||||||
|
PGADMIN_PASSWORD=pgadmin
|
||||||
|
|
||||||
|
# To import servers use /pgadmin4/servers.json on first build, then remove.
|
||||||
|
PGADMIN_SERVERS_JSON=
|
||||||
|
PGADMIN_CONFIG_SERVER_MODE=True
|
||||||
|
|
||||||
#------------------------------#
|
#------------------------------#
|
||||||
# Project Configurations #
|
# Project Configurations #
|
||||||
#------------------------------#
|
#------------------------------#
|
||||||
# Docker
|
# Docker
|
||||||
PROJECT_NAME=odoocker
|
PROJECT_NAME=${PROJECT_NAME}
|
||||||
SUPPORT_EMAIL=mail@example.com
|
SUPPORT_EMAIL=mail@example.com
|
||||||
|
|
||||||
|
# Service configuration
|
||||||
|
USE_REDIS=${USE_REDIS}
|
||||||
|
USE_S3=${USE_S3}
|
||||||
|
USE_SENTRY=${USE_SENTRY}
|
||||||
|
USE_PGADMIN=${USE_PGADMIN}
|
||||||
|
|
||||||
|
# Which services are going to be brought up
|
||||||
|
COMPOSE_PROFILES=${SERVICES}
|
||||||
|
|
||||||
|
# Service profiles
|
||||||
|
ODOO_PROFILES="odoo"
|
||||||
|
POSTGRES_PROFILES="postgres"
|
||||||
|
NGINX_PROFILES="nginx"
|
||||||
|
NGINX_PROXY_PROFILES="proxy"
|
||||||
|
ACME_COMPANION_PROFILES="acme"
|
||||||
|
KEYDB_PROFILES="keydb"
|
||||||
|
MINIO_PROFILES="minio"
|
||||||
|
PGADMIN_PROFILES="pgadmin"
|
||||||
|
|
||||||
# Containers' Tags
|
# Containers' Tags
|
||||||
ODOO_TAG=16.0
|
ODOO_TAG=17.0
|
||||||
POSTGRES_TAG=15.4
|
POSTGRES_TAG=16.1
|
||||||
NGINX_TAG=1.25.2
|
KEYDB_TAG=latest
|
||||||
NGINX_PROXY_TAG=1.3.1
|
MINIO_TAG=latest
|
||||||
ACME_COMPANION_TAG=2.2.8
|
NGINX_TAG=1.25.3
|
||||||
PGADMIN_TAG=7.6
|
NGINX_PROXY_TAG=1.4.0
|
||||||
|
ACME_COMPANION_TAG=2.2.9
|
||||||
|
PGADMIN_TAG=8.1
|
||||||
|
|
||||||
|
# Odoocker paths
|
||||||
|
COMMUNITY_ADDONS=${ROOT_PATH}/addons
|
||||||
|
ENTERPRISE_ADDONS=${ROOT_PATH}/enterprise
|
||||||
|
THIRD_PARTY_ADDONS=${ROOT_PATH}/third-party-addons
|
||||||
|
EXTRA_ADDONS=${ROOT_PATH}/extra-addons
|
||||||
|
CUSTOM_ADDONS=${ROOT_PATH}/custom-addons
|
||||||
|
LOG_PATH=/var/log/odoo/odoo.log
|
||||||
|
DEBUG_PATH=/usr/bin/odoo
|
||||||
|
|
||||||
#------------#
|
#------------#
|
||||||
# Odoo #
|
# Odoo #
|
||||||
@@ -78,22 +175,14 @@ PGADMIN_TAG=7.6
|
|||||||
ADMIN_PASSWD=${ADMIN_PASSWD}
|
ADMIN_PASSWD=${ADMIN_PASSWD}
|
||||||
CSV_INTERNAL_SEP=,
|
CSV_INTERNAL_SEP=,
|
||||||
PUBLISHER_WARRANTY_URL=http://services.openerp.com/publisher-warranty/
|
PUBLISHER_WARRANTY_URL=http://services.openerp.com/publisher-warranty/
|
||||||
ROOT_PATH=/usr/lib/python3/dist-packages/odoo
|
ROOT_PATH=${ROOT_PATH}
|
||||||
REPORTGZ=False
|
REPORTGZ=False
|
||||||
WEBSOCKET_KEEP_ALIVE_TIMEOUT=3600
|
WEBSOCKET_KEEP_ALIVE_TIMEOUT=3600
|
||||||
WEBSOCKET_RATE_LIMIT_BURST=10
|
WEBSOCKET_RATE_LIMIT_BURST=10
|
||||||
WEBSOCKET_RATE_LIMIT_DELAY=0.2
|
WEBSOCKET_RATE_LIMIT_DELAY=0.2
|
||||||
|
|
||||||
# Custom paths
|
|
||||||
COMMUNITY_ADDONS=${ROOT_PATH}/addons
|
|
||||||
ENTERPRISE_ADDONS=${ROOT_PATH}/enterprise
|
|
||||||
EXTRA_ADDONS=${ROOT_PATH}/extra-addons
|
|
||||||
CUSTOM_ADDONS=${ROOT_PATH}/custom-addons
|
|
||||||
LOG_PATH=/var/log/odoo/odoo.log
|
|
||||||
DEBUG_PATH=/usr/bin/odoo
|
|
||||||
|
|
||||||
# Server startup config
|
# Server startup config
|
||||||
ODOO_RC=/etc/odoo/odoo.conf
|
ODOO_RC=${ROOT_PATH}/odoo.conf
|
||||||
SAVE=False
|
SAVE=False
|
||||||
INIT=${INIT}
|
INIT=${INIT}
|
||||||
UPDATE=${UPDATE}
|
UPDATE=${UPDATE}
|
||||||
@@ -101,7 +190,7 @@ DEMO=False
|
|||||||
WITHOUT_DEMO=all
|
WITHOUT_DEMO=all
|
||||||
IMPORT_PARTIAL=False
|
IMPORT_PARTIAL=False
|
||||||
PIDFILE=
|
PIDFILE=
|
||||||
ADDONS_PATH=${COMMUNITY_ADDONS},${ENTERPRISE_ADDONS},${EXTRA_ADDONS},${CUSTOM_ADDONS}
|
ADDONS_PATH=${COMMUNITY_ADDONS},${ENTERPRISE_ADDONS},${THIRD_PARTY_ADDONS},${EXTRA_ADDONS},${CUSTOM_ADDONS}
|
||||||
UPGRADE_PATH=
|
UPGRADE_PATH=
|
||||||
SERVER_WIDE_MODULES=${LOAD}
|
SERVER_WIDE_MODULES=${LOAD}
|
||||||
DATA_DIR=/var/lib/odoo
|
DATA_DIR=/var/lib/odoo
|
||||||
@@ -119,21 +208,22 @@ XMLRPCS=True
|
|||||||
PROXY_MODE=True
|
PROXY_MODE=True
|
||||||
X_SENDFILE=False
|
X_SENDFILE=False
|
||||||
|
|
||||||
# Testing
|
# Testing Group
|
||||||
TEST_FILE=False
|
TEST_FILE=False
|
||||||
TEST_ENABLE=${TEST_ENABLE}
|
TEST_ENABLE=${TEST_ENABLE}
|
||||||
TEST_TAGS=${TEST_TAGS}
|
TEST_TAGS=${TEST_TAGS}
|
||||||
SCREENCASTS=None
|
SCREENCASTS=None
|
||||||
SCREENSHOTS=/tmp/odoo_tests
|
SCREENSHOTS=/tmp/odoo_tests
|
||||||
|
|
||||||
# Logging
|
# Logging Group
|
||||||
LOG_LEVEL=${LOG_LEVEL}
|
LOG_LEVEL=${LOG_LEVEL}
|
||||||
LOG_HANDLER=odoo.http.rpc.request:${LOG_HANDLER_LEVEL},odoo.http.rpc.response:${LOG_HANDLER_LEVEL},:${LOG_HANDLER_LEVEL},odoo.sql_db:${LOG_HANDLER_LEVEL}
|
LOG_HANDLER=odoo.http.rpc.request:${LOG_HANDLER_LEVEL},odoo.http.rpc.response:${LOG_HANDLER_LEVEL},:${LOG_HANDLER_LEVEL},odoo.sql_db:${LOG_HANDLER_LEVEL}
|
||||||
|
LOG_DB=False
|
||||||
LOG_DB_LEVEL=${LOG_LEVEL}
|
LOG_DB_LEVEL=${LOG_LEVEL}
|
||||||
SYSLOG=False
|
SYSLOG=False
|
||||||
LOGFILE=
|
LOGFILE=
|
||||||
|
|
||||||
# Email
|
# SMTP Group
|
||||||
EMAIL_FROM=${EMAIL_FROM}
|
EMAIL_FROM=${EMAIL_FROM}
|
||||||
FROM_FILTER=${FROM_FILTER}
|
FROM_FILTER=${FROM_FILTER}
|
||||||
SMTP_SERVER=${SMTP_SERVER}
|
SMTP_SERVER=${SMTP_SERVER}
|
||||||
@@ -183,6 +273,29 @@ LIMIT_TIME_REAL=480
|
|||||||
LIMIT_TIME_REAL_CRON=600
|
LIMIT_TIME_REAL_CRON=600
|
||||||
LIMIT_REQUEST=8192
|
LIMIT_REQUEST=8192
|
||||||
|
|
||||||
|
# Redis
|
||||||
|
ODOO_SESSION_REDIS=${SESSION_REDIS}
|
||||||
|
ODOO_SESSION_REDIS_HOST=${REDIS_HOST}
|
||||||
|
ODOO_SESSION_REDIS_PORT=${REDIS_PORT}
|
||||||
|
ODOO_SESSION_REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||||
|
ODOO_SESSION_REDIS_URL=${REDIS_URL}
|
||||||
|
ODOO_SESSION_REDIS_PREFIX=${REDIS_PREFIX}
|
||||||
|
ODOO_SESSION_REDIS_SENTINEL_MASTER_NAME=${REDIS_SENTINEL_MASTER_NAME}
|
||||||
|
ODOO_SESSION_REDIS_SENTINEL_HOST=${REDIS_SENTINEL_HOST}
|
||||||
|
ODOO_SESSION_REDIS_SENTINEL_PORT=${REDIS_SENTINEL_PORT}
|
||||||
|
ODOO_SESSION_REDIS_EXPIRATION=${REDIS_EXPIRATION}
|
||||||
|
ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS=${REDIS_EXPIRATION_ANONYMOUS}
|
||||||
|
|
||||||
|
# Base Attachment Object Storage
|
||||||
|
DISABLE_ATTACHMENT_STORAGE=0
|
||||||
|
|
||||||
|
# S3
|
||||||
|
AWS_HOST=${AWS_HOST}
|
||||||
|
AWS_REGION=${AWS_REGION}
|
||||||
|
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
||||||
|
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
||||||
|
AWS_BUCKETNAME=${AWS_BUCKETNAME}
|
||||||
|
|
||||||
#--------------#
|
#--------------#
|
||||||
# Docker #
|
# Docker #
|
||||||
#--------------#
|
#--------------#
|
||||||
@@ -193,11 +306,11 @@ TEMP_DOCKER_SOCK=/tmp/docker.sock
|
|||||||
#----------------#
|
#----------------#
|
||||||
# Postgres #
|
# Postgres #
|
||||||
#----------------#
|
#----------------#
|
||||||
POSTGRES_HOST=${DB_HOST}
|
POSTGRES_HOST=${POSTGRES_MAIN_HOST}
|
||||||
POSTGRES_PORT=${DB_PORT}
|
POSTGRES_PORT=${POSTGRES_MAIN_PORT}
|
||||||
POSTGRES_DB=postgres
|
POSTGRES_DB=${POSTGRES_MAIN_DB}
|
||||||
POSTGRES_USER=${DB_USER}
|
POSTGRES_USER=${POSTGRES_MAIN_USER}
|
||||||
POSTGRES_PASSWORD=${DB_PASSWORD}
|
POSTGRES_PASSWORD=${POSTGRES_MAIN_PASSWORD}
|
||||||
PGDATA=/var/lib/postgresql/data/${PROJECT_NAME}
|
PGDATA=/var/lib/postgresql/data/${PROJECT_NAME}
|
||||||
|
|
||||||
#-------------#
|
#-------------#
|
||||||
@@ -210,16 +323,6 @@ LETSENCRYPT_HOST=${DOMAIN}
|
|||||||
LETSENCRYPT_EMAIL=${SUPPORT_EMAIL}
|
LETSENCRYPT_EMAIL=${SUPPORT_EMAIL}
|
||||||
CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN}
|
CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN}
|
||||||
|
|
||||||
#-------------#
|
|
||||||
# PgAdmin #
|
|
||||||
#-------------#
|
|
||||||
PGADMIN_DATA=/var/lib/pgadmin
|
|
||||||
PGADMIN_VIRTUAL_HOST=${PGADMIN_DOMAIN}
|
|
||||||
PGADMIN_DEFAULT_EMAIL=${SUPPORT_EMAIL}
|
|
||||||
PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD}
|
|
||||||
PGADMIN_LETSENCRYPT_HOST=${PGADMIN_DOMAIN}
|
|
||||||
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
|
|
||||||
|
|
||||||
#-------------------#
|
#-------------------#
|
||||||
# Nginx Proxy #
|
# Nginx Proxy #
|
||||||
#-------------------#
|
#-------------------#
|
||||||
@@ -234,4 +337,77 @@ CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN}
|
|||||||
#----------------------#
|
#----------------------#
|
||||||
# ACME Companion #
|
# ACME Companion #
|
||||||
#----------------------#
|
#----------------------#
|
||||||
|
# For prod use: https://acme-v02.api.letsencrypt.org/directory
|
||||||
|
ACME_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
CERTS_UPDATE_INTERVAL=3600
|
||||||
DEFAULT_EMAIL=${SUPPORT_EMAIL}
|
DEFAULT_EMAIL=${SUPPORT_EMAIL}
|
||||||
|
|
||||||
|
#-------------#
|
||||||
|
# Redis #
|
||||||
|
#-------------#
|
||||||
|
KEYDB_PORT=${REDIS_PORT}
|
||||||
|
KEYDB_DATA=/var/lib/keydb
|
||||||
|
|
||||||
|
#-------------#
|
||||||
|
# Minio #
|
||||||
|
#-------------#
|
||||||
|
MINIO_ROOT_USER=${AWS_ACCESS_KEY_ID}
|
||||||
|
MINIO_ROOT_PASSWORD=${AWS_SECRET_ACCESS_KEY}
|
||||||
|
MINIO_VIRTUAL_HOST=${S3_VIRTUAL_HOST}
|
||||||
|
MINIO_BROWSER_REDIRECT_URL=http://${MINIO_VIRTUAL_HOST}
|
||||||
|
MINIO_API_PORT=${S3_API_PORT}
|
||||||
|
MINIO_CONSOLE_PORT=${S3_CONSOLE_PORT}
|
||||||
|
MINIO_DATA=/data
|
||||||
|
|
||||||
|
#-------------#
|
||||||
|
# PgAdmin #
|
||||||
|
#-------------#
|
||||||
|
# Volume path
|
||||||
|
PGADMIN_DATA=/var/lib/pgadmin
|
||||||
|
|
||||||
|
# Nginx Proxy Configuration
|
||||||
|
PGADMIN_VIRTUAL_HOST=${PGADMIN_DOMAIN}
|
||||||
|
PGADMIN_LETSENCRYPT_HOST=${PGADMIN_DOMAIN}
|
||||||
|
PGADMIN_LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
|
||||||
|
|
||||||
|
# PgAdmin Configuration
|
||||||
|
PGADMIN_CONFIG_APP_NAME="'pgAdmin 4'"
|
||||||
|
PGADMIN_CONFIG_SERVER_MODE=${PGADMIN_CONFIG_SERVER_MODE}
|
||||||
|
PGADMIN_CONFIG_DEFAULT_SERVER="'127.0.0.1'"
|
||||||
|
PGADMIN_CONFIG_DEFAULT_SERVER_PORT=5050
|
||||||
|
PGADMIN_CONFIG_MAX_SESSION_IDLE_TIME=120
|
||||||
|
PGADMIN_CONFIG_MAX_QUERY_HIST_STORED=20
|
||||||
|
# Security Settings
|
||||||
|
PGADMIN_CONFIG_PASSWORD_LENGTH_MIN=6
|
||||||
|
PGADMIN_CONFIG_ALLOW_SAVE_PASSWORD=True
|
||||||
|
PGADMIN_CONFIG_ALLOW_SAVE_TUNNEL_PASSWORD=True
|
||||||
|
PGADMIN_CONFIG_MAX_LOGIN_ATTEMPTS=10
|
||||||
|
# DB Configuration
|
||||||
|
PGADMIN_CONFIG_CONFIG_DATABASE_URI=${PGADMIN_DB_HOST}
|
||||||
|
PGADMIN_CONFIG_CONFIG_DATABASE_CONNECTION_POOL_SIZE=5
|
||||||
|
# Load Shared Servers Configuration into DB
|
||||||
|
PGADMIN_SERVERS_JSON=${PGADMIN_SERVERS_JSON}
|
||||||
|
|
||||||
|
# Authentication
|
||||||
|
PGADMIN_DEFAULT_EMAIL=${PGADMIN_EMAIL}
|
||||||
|
PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PASSWORD}
|
||||||
|
|
||||||
|
# PgAdmin SMTP Server
|
||||||
|
PGADMIN_CONFIG_MAIL_SERVER="'localhost'"
|
||||||
|
PGADMIN_CONFIG_MAIL_PORT=25
|
||||||
|
PGADMIN_CONFIG_MAIL_USE_SSL=False
|
||||||
|
PGADMIN_CONFIG_MAIL_USE_TLS=False
|
||||||
|
PGADMIN_CONFIG_MAIL_USERNAME="''"
|
||||||
|
PGADMIN_CONFIG_MAIL_PASSWORD="''"
|
||||||
|
PGADMIN_CONFIG_MAIL_DEBUG=False
|
||||||
|
PGADMIN_CONFIG_SECURITY_EMAIL_SENDER="'$PGADMIN_DEFAULT_EMAIL'"
|
||||||
|
|
||||||
|
# Dynamic PgAdmin Servers (Add as many as you need following copying these variables like {DB1}, {DB2}, DB3)
|
||||||
|
PGADMIN_DB1_NAME=Odoocker
|
||||||
|
PGADMIN_DB1_HOST=localhost
|
||||||
|
PGADMIN_DB1_PORT=5432
|
||||||
|
PGADMIN_DB1_MAINTENANCE_DB=odoocker
|
||||||
|
PGADMIN_DB1_USERNAME=odoo
|
||||||
|
PGADMIN_DB1_TUNNEL_HOST=erp.odoocker.test
|
||||||
|
PGADMIN_DB1_TUNNEL_PORT=22
|
||||||
|
PGADMIN_DB1_TUNNEL_USERNAME=ubuntu
|
||||||
|
|||||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
### :rocket: Deployment
|
### :rocket: Deployment
|
||||||
- `INIT="my_custom_addon_1"`
|
- `INIT="my_custom_addon_1"`
|
||||||
- `ADDONS_TO_UPGRADE="my_custom_addon_2"`
|
- `UPDATE="my_custom_addon_2"`
|
||||||
|
|
||||||
### :jigsaw: Odoo/Asana Tasks
|
### :jigsaw: Odoo/Asana Tasks
|
||||||
- *Paste Task URL*
|
- *Paste Task URL*
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,6 +1,9 @@
|
|||||||
# Ignores the main configuration file.
|
# Ignores the main configuration file.
|
||||||
/.env
|
/.env
|
||||||
|
|
||||||
|
# Ignores the pgadmin private key
|
||||||
|
pgadmin/private_key
|
||||||
|
|
||||||
# Ignores the docker compose local or production environment.
|
# Ignores the docker compose local or production environment.
|
||||||
docker-compose.override.yml
|
docker-compose.override.yml
|
||||||
|
|
||||||
|
|||||||
88
README.md
88
README.md
@@ -2,27 +2,18 @@
|
|||||||
|
|
||||||
Welcome to Odoocker, a game-changer in the world of Odoo Development and Deployment. This tool is meticulously crafted to revolutionize your experience with Odoo, ensuring simplicity, efficiency, and a top-tier development journey. And while it’s rooted in the principles of the Official Odoo Docker setup, it goes several steps beyond.
|
Welcome to Odoocker, a game-changer in the world of Odoo Development and Deployment. This tool is meticulously crafted to revolutionize your experience with Odoo, ensuring simplicity, efficiency, and a top-tier development journey. And while it’s rooted in the principles of the Official Odoo Docker setup, it goes several steps beyond.
|
||||||
|
|
||||||
**Best of all**, you don't need any prior knowledge of **Odoo** or **Docker** to start your journey with Odoocker.
|
Whether you're using the **Community** or **Enterprise** edition, this **Docker** solution is tailored just for you.
|
||||||
|
|
||||||
|
**Best part of this?** You don't need any prior knowledge of **Docker**, **Odoo** or any technology that involves this Framework. We stick to Docker philosophy: **Use it, then learn about it.**
|
||||||
|
|
||||||
Feel free to post a Pull Request to continue enhancing this project.
|
Feel free to post a Pull Request to continue enhancing this project.
|
||||||
|
|
||||||
### Why Odoocker Stands Out:
|
### Why Odoocker Stands Out:
|
||||||
|
1. 🌐 **Universal:** Suitable for both Odoo Community and Enterprise editions.
|
||||||
|
2. 📦 **Easy Setup:** Clone, configure `.env` file, and you're ready to deploy.
|
||||||
|
3. 🔒 **Secure:** Automatic SSL certificate renewal to keep your data safe (for production only).
|
||||||
|
|
||||||
1. **Minimalistic Server Approach**: In an era where less is more, we keep server clutter at bay. With Odoocker, you'll witness a decluttered server environment, stripped down to the bare essentials. This minimalism ensures optimal resource utilization, leading to faster response times, reduced chances of conflicts, and a smooth-running Odoo instance.
|
In essence, Odoocker isn't just another tool, it's a philosophy. So, whether you’re a seasoned Odoo veteran or just starting your journey, Odoocker is here to make your journey easier.
|
||||||
|
|
||||||
2. **Usability at its Core**: Odoocker is user-centric. By keeping the interface intuitive and the processes straightforward, we ensure that even newcomers to the Odoo ecosystem can set up and deploy with relative ease.
|
|
||||||
|
|
||||||
3. **Dynamic Yet Simple Configuration**: Customization doesn't have to be complicated. With our `.env` setup, adapting your Odoo instance to your unique needs is a breeze, ensuring you have the flexibility without the fuss.
|
|
||||||
|
|
||||||
4. **Streamlined Development Cycle**: With our intuitive steps and tips, deploying Odoo becomes as simple as 1-2-3. The goal is clear: *to ensure developers do what they love most, code*.
|
|
||||||
|
|
||||||
5. **Clean, Unadulterated Performance**: With a spotlight on a single Odoo instance and a decluttered server, performance optimization is a given. Expect faster load times, smoother operations, and a user experience that’s top-notch.
|
|
||||||
|
|
||||||
In essence, Odoocker isn't just another tool in the developer's arsenal. It's a philosophy. A commitment to clean, efficient, and delightful Odoo development. So, whether you’re a seasoned Odoo veteran or just starting your journey, Odoocker is here to make sure it’s smooth sailing all the way.
|
|
||||||
|
|
||||||
Note: We always recommend keeping abreast with the official documentation for the most detailed and updated insights. Knowledge is power, after all.
|
|
||||||
|
|
||||||
**Note:** While we've aimed to make things simpler, always refer to the official documentation for detailed information and updates. After all, knowledge is power!
|
|
||||||
|
|
||||||
## Contents
|
## Contents
|
||||||
|
|
||||||
@@ -49,9 +40,10 @@ Note: We always recommend keeping abreast with the official documentation for th
|
|||||||
|
|
||||||
# Quick Setup Guide:
|
# Quick Setup Guide:
|
||||||
|
|
||||||
1. **Clone and Prep**: Get your hands on this wonder-tool in seconds with a simple clone and a few copy commands:
|
1. **Clone and Configure**:
|
||||||
```
|
```
|
||||||
git clone git@github.com:yhaelopez/odoocker.git
|
git clone git@github.com:odoocker/odoocker.git
|
||||||
|
cd odoocker
|
||||||
cp .env.example .env && cp docker-compose.override.local.yml docker-compose.override.yml
|
cp .env.example .env && cp docker-compose.override.local.yml docker-compose.override.yml
|
||||||
```
|
```
|
||||||
2. **Hosts & Domains**: To ensure everything runs smoothly, remember to add the necessary domains to your hosts file.
|
2. **Hosts & Domains**: To ensure everything runs smoothly, remember to add the necessary domains to your hosts file.
|
||||||
@@ -68,9 +60,9 @@ For *Windows*, manually add these lines to C:\Windows\System32\drivers\etc\hosts
|
|||||||
```
|
```
|
||||||
|
|
||||||
# The `.env` File
|
# The `.env` File
|
||||||
The environment variables located in [`.env`](https://github.com/yhaelopez/odoocker/blob/main/.env.example) provide dynamic configurations to Odoo and the project in general.
|
The environment variables located in [`.env`](https://github.com/odoocker/odoocker/blob/main/.env.example) provide dynamic configurations to Odoo and the project in general.
|
||||||
The [`odoo.conf`](https://github.com/yhaelopez/odoocker/blob/main/odoo/odoo.example.conf) file is generated by the [`odoorc.sh`](https://github.com/yhaelopez/odoocker/blob/main/odoo/odoorc.sh) script based on the environment variables.
|
The [`odoo.conf`](https://github.com/odoocker/odoocker/blob/main/odoo/odoo.example.conf) file is generated by the [`odoorc.sh`](https://github.com/odoocker/odoocker/blob/main/odoo/odoorc.sh) script based on the environment variables.
|
||||||
|
<br>
|
||||||
This file is divided in sections, you most likely are going to focus on the `Main Configuration` section. This provides quick access to project and `odoo.conf` variables. The rest of section are container specific variables for different container. (Note: you may find *repeated variables* like `SUPPORT_EMAIL=${SUPPORT_EMAIL}` which interacts with different containers. This is to explicitly denote in the `.env` file that this variable is being shared through those containers.
|
This file is divided in sections, you most likely are going to focus on the `Main Configuration` section. This provides quick access to project and `odoo.conf` variables. The rest of section are container specific variables for different container. (Note: you may find *repeated variables* like `SUPPORT_EMAIL=${SUPPORT_EMAIL}` which interacts with different containers. This is to explicitly denote in the `.env` file that this variable is being shared through those containers.
|
||||||
|
|
||||||
Sample `.env` file:
|
Sample `.env` file:
|
||||||
@@ -85,7 +77,8 @@ DEV_MODE=reload,qweb
|
|||||||
DOMAIN=erp.odoocker.test
|
DOMAIN=erp.odoocker.test
|
||||||
|
|
||||||
# Enterprise (GitHub User with access to Odoo Enterprise [https://github.com/odoo/enterprise] Repo)
|
# Enterprise (GitHub User with access to Odoo Enterprise [https://github.com/odoo/enterprise] Repo)
|
||||||
GITHUB_USER=yhaelopez
|
# If not present, Odoo Community will be brought up.
|
||||||
|
GITHUB_USER=odoocker
|
||||||
GITHUB_ACCESS_TOKEN=ghp_token
|
GITHUB_ACCESS_TOKEN=ghp_token
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
@@ -98,32 +91,37 @@ DB_PASSWORD=odoo
|
|||||||
LOAD_LANGUAGE=es_MX
|
LOAD_LANGUAGE=es_MX
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
<br>
|
||||||
|
|
||||||
## Environment-based actions:
|
## Environment-based actions:
|
||||||
[`odoo/entrypoint.sh`](https://github.com/yhaelopez/odoocker/blob/main/odoo/entrypoint.sh) file is the gateway for our Odoo container. Depending on the `APP_ENV` and the rest of the environment variables, it determines how to start the Odoo service (like local, testing, production, etc.) with different configurations.
|
[`odoo/entrypoint.sh`](https://github.com/odoocker/odoocker/blob/main/odoo/entrypoint.sh) file is the gateway for our Odoo container. Depending on the `APP_ENV` and the rest of the environment variables, it determines how to start the Odoo service (like local, testing, production, etc.) with different configurations.
|
||||||
|
<br>
|
||||||
|
In all environments, `odoo.conf` follows the `.env` file variables. Some environments may have command-line parameter to overwrite certain configurations.
|
||||||
|
|
||||||
All environments receive the whole `.env` file variables. However, some of them have fixed command-line variables specific for each environment. For example, some of them may have `--limit-time-cpu=3600` because some databases are so big that may require a huge amount of seconds. Setting 1 hour ensures any DB can be imported (this can change as needed in the specific project). These values in command line overwrite the ones in the `.env` file.
|
**To bring up all the environments run**:
|
||||||
|
```
|
||||||
**To bring up most of the following environments run**:
|
docker-compose up -d --build && docker-compose logs odoo
|
||||||
|
```
|
||||||
|
Restart adding `down`:
|
||||||
```
|
```
|
||||||
docker-compose down && docker-compose up -d --build && docker-compose logs odoo
|
docker-compose down && docker-compose up -d --build && docker-compose logs odoo
|
||||||
```
|
```
|
||||||
|
|
||||||
Here are the descriptions of each of them.
|
|
||||||
|
|
||||||
### 1. Fresh or Restore
|
### 1. Fresh or Restore
|
||||||
These environments (`APP_ENV=fresh` or `APP_ENV=restore`) will have no database created and are perfect for setting up a fresh database instance or restoring a production database.
|
These environments (`APP_ENV=fresh` or `APP_ENV=restore`) will have no database created. Are perfect for setting up a **fresh database** instance or **restoring a production database**.
|
||||||
|
|
||||||
### 2. Local:
|
### 2. Local:
|
||||||
This environment (`APP_ENV=local`) will strictly follow the `.env` variables with no command-line overwrites. You'll most likely be using this regularly.
|
This environment (`APP_ENV=local`) will strictly follow the `.env` variables with no command-line overwrites. You'll most likely be using this regularly.
|
||||||
Use `DEV_MODE=reload,qweb` to activate hot reload when changing `python` and `xml` files.
|
Use `DEV_MODE=reload,qweb` to activate hot reload when changing `python` and `xml` files.
|
||||||
|
<br>
|
||||||
If you prefer to update the packages everytime you restart Odoo container, you can set `UPDATE=module1,module2,module3`.
|
If you prefer to update the packages everytime you restart Odoo container, you can set `UPDATE=module1,module2,module3`.
|
||||||
|
|
||||||
### 3. Debug:
|
### 3. Debug:
|
||||||
This environment (`APP_ENV=debug`) works same way as local, but it starts Odoo using the `debugpy` library. Thanks to our [`.vscode/launch.json`](https://github.com/yhaelopez/odoocker/blob/main/.vscode/launch.json), if you are using Visual Studio Code, you start a Debugger session and the container will be aware of your breakpoints and stop wherever you need. This is my favorite environment to work since I use the debugger a lot while developing.
|
This environment (`APP_ENV=debug`) works same way as local, but it starts Odoo using the `debugpy` library. Thanks to our [`.vscode/launch.json`](https://github.com/odoocker/odoocker/blob/main/.vscode/launch.json), if you are using **Visual Studio Code**, you can start a Debugger session so the container is aware of your breakpoints and stop wherever you need. This is **my favorite** environment to work since I use the debugger a lot while developing.
|
||||||
|
|
||||||
### 4. Testing:
|
### 4. Testing:
|
||||||
This environment (`APP_ENV=testing`) is specific for running tests (and will be included in a CI/CD pipeline in a future version). It help us test the modules we are developing to ensure a safe deployment.
|
This environment (`APP_ENV=testing`) is specific for running tests *(and will be included in a CI/CD pipeline in a future version)*. It help us test the modules we are developing to ensure a safe deployment.
|
||||||
|
<br>
|
||||||
A `test_DB_NAME` database is automagically created.
|
A `test_DB_NAME` database is automagically created.
|
||||||
The `ADDONS_TO_TEST=addon_1` are installed in that fresh DB.
|
The `ADDONS_TO_TEST=addon_1` are installed in that fresh DB.
|
||||||
Use `TEST_TAGS=test_tag_1` to filter your tests.
|
Use `TEST_TAGS=test_tag_1` to filter your tests.
|
||||||
@@ -131,24 +129,24 @@ Use `TEST_TAGS=test_tag_1` to filter your tests.
|
|||||||
**NOTE: Avoid running tests without tags**; otherwise, it will trigger tests in all installed addons and we don't want this. For now, let's assume Odoo Community & Enterprise tests passed and only focus on the things you need to test.
|
**NOTE: Avoid running tests without tags**; otherwise, it will trigger tests in all installed addons and we don't want this. For now, let's assume Odoo Community & Enterprise tests passed and only focus on the things you need to test.
|
||||||
|
|
||||||
### 5. Full:
|
### 5. Full:
|
||||||
This environment (`APP_ENV=full`) will install the `INIT` modules in a new or existing `DB_NAME`. This allows us to have a fresh production database replica.
|
This environment (`APP_ENV=full`) will install the `INIT` modules in a new or existing `DB_NAME`. It allows us to have a fresh production database replica.
|
||||||
|
|
||||||
### 6. Staging:
|
### 6. Staging:
|
||||||
This environment (`APP_ENV=staging`) sets `UPDATE=all`; this allows us to *update* all installed addons at once.
|
This environment (`APP_ENV=staging`) sets `UPDATE=all`; it allows us to **update all installed addons at once**.
|
||||||
|
<br>
|
||||||
It also allows to install new packages before the upgrade through `INIT`.
|
It also allows to install new packages before the upgrade through `INIT`.
|
||||||
|
<br>
|
||||||
It's highly recommended to use this command to run this environment
|
It's highly recommended to use this command to run this environment
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose down && git pull && docker-compose pull && docker-compose build --no-cache && docker-compose up -d && docker-compose logs -f odoo
|
docker-compose down && docker-compose pull && docker-compose build --no-cache && docker-compose up -d && docker-compose logs -f odoo
|
||||||
```
|
```
|
||||||
|
|
||||||
This will `pull` the latest *Odoo Community, Enterprise, Extra and Custom addons*, basically, it upgrades the whole Odoo instance to the newest. Additionally, it will also pull the latest images of the other containers in this project.
|
This will `pull` the latest *Odoo Community, Enterprise, Extra and Custom addons*, basically, it **upgrades the whole Odoo instance** to the newest. Additionally, it will also pull the latest images of the other containers in this project. This environment is perfect for deployments.
|
||||||
|
|
||||||
**NOTE: Do not bring down & up again unless you want to perform a whole update again.**
|
**NOTE: Do not bring down & up again, unless you want to perform a whole upgrade again.**
|
||||||
|
|
||||||
### 7. Production:
|
### 7. Production:
|
||||||
This is the production environment (`APP_ENV=production`). It ensures no demo data is loaded and debugging is turned off. It also brings up the `Let's Encrypt` container, so you won't worry about `SSL Certificates` anymore! Some `.env` variables are overwritten in this setup.
|
This environment (`APP_ENV=production`) ensures no demo data is loaded, debugging and dev_mode are turned off. It also brings up the `Let's Encrypt` container, so you won't worry about `SSL Certificates` anymore! Some `.env` variables are overwritten in this setup.
|
||||||
|
|
||||||
- Take down previous setup of containers
|
- Take down previous setup of containers
|
||||||
```
|
```
|
||||||
@@ -158,6 +156,8 @@ docker-compose down
|
|||||||
```
|
```
|
||||||
cp docker-compose.override.production.yml docker-compose.override.yml
|
cp docker-compose.override.production.yml docker-compose.override.yml
|
||||||
```
|
```
|
||||||
|
- Update .env `SERVICES` (add `acme`) and `ACME_CA_URI` (use production link).
|
||||||
|
- Make sure the DNS record of your `DOMAIN` is pointing to your server.
|
||||||
- Rebuild the containers
|
- Rebuild the containers
|
||||||
```
|
```
|
||||||
docker-compose up -d --build && docker-compose logs odoo
|
docker-compose up -d --build && docker-compose logs odoo
|
||||||
@@ -167,7 +167,9 @@ docker-compose up -d --build && docker-compose logs odoo
|
|||||||
The following tips will enhance your developing and production experience.
|
The following tips will enhance your developing and production experience.
|
||||||
|
|
||||||
## 1. Search through all Addons at once:
|
## 1. Search through all Addons at once:
|
||||||
If you are using `Visual Studio Code` & the Docker Extension is installed, you can open the Odoo Container in the `ROOT_PATH`. There you will find all Odoo `Community Addons`, `Enterprise Addons`, `Extra Addons` and `Custom Addons`. The Extra and Custom addons coming from your project.
|
If you are using `Visual Studio Code` & the **Docker Extension** is installed, you can open the Odoo Container in the `ROOT_PATH`. There you will find all Odoo `Community Addons`, `Enterprise Addons`, `Extra Addons` and `Custom Addons` in the same folder level.
|
||||||
|
<br>
|
||||||
|
Using the Search Panel will allow you to look at every single reference of what you are looking for in the whole Odoo Instance and not just in your addons.
|
||||||
|
|
||||||
## 2. Define the following aliases:
|
## 2. Define the following aliases:
|
||||||
```
|
```
|
||||||
@@ -182,8 +184,8 @@ alias logs='docker-compose logs -f --tail 2000 odoo'
|
|||||||
|
|
||||||
## 3. NEVER run `docker-compose down -v` in Production
|
## 3. NEVER run `docker-compose down -v` in Production
|
||||||
...without having a `tested backed up` database
|
...without having a `tested backed up` database
|
||||||
|
<br>
|
||||||
Have in mind that dropping volumes will destroy DB data, Odoo Conf & Filestore, *Let's Encrypt certificates, and more!*. If you execute this command several times in `prod` in a short period of time, you may reach the `Let's Encrypt` certificates limit and Odoocker won't be able to generate new ones after **several hours**.
|
Have in mind that dropping volumes will destroy DB data, Odoo Conf & Filestore, *Let's Encrypt certificates, and more!* If you execute this command several times in `prod` in a short period of time, you may reach the `Let's Encrypt certificates limit`` and Odoocker won't be able to generate new ones after **several hours**.
|
||||||
|
|
||||||
## 4. Odoo Shell
|
## 4. Odoo Shell
|
||||||
1. Log into the odoo container
|
1. Log into the odoo container
|
||||||
@@ -243,7 +245,7 @@ And to turn down
|
|||||||
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.pgadmin.yml down
|
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.pgadmin.yml down
|
||||||
```
|
```
|
||||||
|
|
||||||
If your instance has pgAdmin, make sure you adapt this to your aliases.
|
If your instance has pgAdmin, make sure you adapt your aliases to this configuration.
|
||||||
|
|
||||||
# Deployment Process
|
# Deployment Process
|
||||||
Note: the deployment process is easier & faster with aliases.
|
Note: the deployment process is easier & faster with aliases.
|
||||||
|
|||||||
@@ -19,3 +19,16 @@ services:
|
|||||||
restart: 'no'
|
restart: 'no'
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
|
- 443:443
|
||||||
|
|
||||||
|
letsencrypt:
|
||||||
|
restart: 'no'
|
||||||
|
|
||||||
|
redis:
|
||||||
|
restart: 'no'
|
||||||
|
|
||||||
|
s3:
|
||||||
|
restart: 'no'
|
||||||
|
|
||||||
|
pgadmin:
|
||||||
|
restart: 'no'
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:8069:8069
|
- 127.0.0.1:8069:8069
|
||||||
|
- 127.0.0.1:8070:8070
|
||||||
- 127.0.0.1:8071:8071
|
- 127.0.0.1:8071:8071
|
||||||
- 127.0.0.1:8072:8072
|
- 127.0.0.1:8072:8072
|
||||||
|
|
||||||
@@ -11,6 +12,9 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:5432:5432
|
- 127.0.0.1:5432:5432
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
nginx-proxy:
|
nginx-proxy:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
@@ -18,21 +22,13 @@ services:
|
|||||||
- 443:443
|
- 443:443
|
||||||
|
|
||||||
letsencrypt:
|
letsencrypt:
|
||||||
image: nginxproxy/acme-companion:${ACME_COMPANION_TAG}
|
|
||||||
depends_on:
|
|
||||||
- nginx-proxy
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes_from:
|
|
||||||
- nginx-proxy:rw
|
|
||||||
volumes:
|
|
||||||
- certs:${NGINX_CERTS}:rw
|
|
||||||
- acme:${NGINX_ACME}
|
|
||||||
- ${DOCKER_SOCK}:${DOCKER_SOCK}:ro
|
|
||||||
environment:
|
|
||||||
- DEFAULT_EMAIL
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
|
|
||||||
volumes:
|
redis:
|
||||||
acme:
|
restart: unless-stopped
|
||||||
certs:
|
|
||||||
|
s3:
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
pgadmin:
|
||||||
|
restart: unless-stopped
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
services:
|
|
||||||
pgadmin:
|
|
||||||
image: dpage/pgadmin4:${PGADMIN_TAG}
|
|
||||||
restart: unless-stopped
|
|
||||||
expose:
|
|
||||||
- 80
|
|
||||||
volumes:
|
|
||||||
- pgadmin-data:${PGADMIN_DATA}
|
|
||||||
environment:
|
|
||||||
- PGADMIN_DEFAULT_EMAIL
|
|
||||||
- PGADMIN_DEFAULT_PASSWORD
|
|
||||||
- VIRTUAL_HOST=${PGADMIN_VIRTUAL_HOST}
|
|
||||||
- LETSENCRYPT_HOST=${PGADMIN_LETSENCRYPT_HOST}
|
|
||||||
- LETSENCRYPT_EMAIL
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
pgadmin-data:
|
|
||||||
@@ -7,31 +7,59 @@ services:
|
|||||||
- ODOO_TAG
|
- ODOO_TAG
|
||||||
- ODOO_RC
|
- ODOO_RC
|
||||||
- ROOT_PATH
|
- ROOT_PATH
|
||||||
|
- ENTERPRISE_USER
|
||||||
|
- ENTERPRISE_ACCESS_TOKEN
|
||||||
|
- ENTERPRISE_ADDONS
|
||||||
- GITHUB_USER
|
- GITHUB_USER
|
||||||
- GITHUB_ACCESS_TOKEN
|
- GITHUB_ACCESS_TOKEN
|
||||||
- ENTERPRISE_ADDONS
|
- THIRD_PARTY_ADDONS
|
||||||
- LOG_PATH
|
- LOG_PATH
|
||||||
depends_on:
|
- USE_REDIS
|
||||||
- postgres
|
- USE_S3
|
||||||
|
- USE_SENTRY
|
||||||
tty: true
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
- data-dir:${DATA_DIR}
|
- odoo-data:${DATA_DIR}
|
||||||
- ./odoo/extra-addons:${EXTRA_ADDONS}
|
- ./odoo/extra-addons:${EXTRA_ADDONS}
|
||||||
- ./odoo/custom-addons:${CUSTOM_ADDONS}
|
- ./odoo/custom-addons:${CUSTOM_ADDONS}
|
||||||
- ./odoo/entrypoint.sh:/entrypoint.sh
|
- ./odoo/entrypoint.sh:/entrypoint.sh
|
||||||
- ./odoo/odoorc.sh:/odoorc.sh
|
environment:
|
||||||
env_file:
|
- HOST=${DB_HOST}
|
||||||
- ./.env
|
- PORT=${DB_PORT}
|
||||||
|
- USER=${DB_USER}
|
||||||
|
- PASSWORD=${DB_PASSWORD}
|
||||||
|
- ODOO_TAG
|
||||||
|
- ODOO_RC
|
||||||
|
- USE_REDIS
|
||||||
|
- USE_S3
|
||||||
|
- USE_SENTRY
|
||||||
|
- THIRD_PARTY_ADDONS
|
||||||
|
- ODOO_SESSION_REDIS
|
||||||
|
- ODOO_SESSION_REDIS_HOST
|
||||||
|
- ODOO_SESSION_REDIS_PORT
|
||||||
|
- ODOO_SESSION_REDIS_PASSWORD
|
||||||
|
- ODOO_SESSION_REDIS_URL
|
||||||
|
- ODOO_SESSION_REDIS_PREFIX
|
||||||
|
- ODOO_SESSION_REDIS_SENTINEL_MASTER_NAME
|
||||||
|
- ODOO_SESSION_REDIS_SENTINEL_HOST
|
||||||
|
- ODOO_SESSION_REDIS_SENTINEL_PORT
|
||||||
|
- ODOO_SESSION_REDIS_EXPIRATION
|
||||||
|
- ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS
|
||||||
|
- AWS_HOST
|
||||||
|
- AWS_REGION
|
||||||
|
- AWS_ACCESS_KEY_ID
|
||||||
|
- AWS_SECRET_ACCESS_KEY
|
||||||
|
- AWS_BUCKETNAME
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
profiles: [$ODOO_PROFILES]
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
build:
|
build:
|
||||||
context: ./postgres
|
context: ./
|
||||||
dockerfile: Dockerfile
|
dockerfile: ./postgres/Dockerfile
|
||||||
args:
|
args:
|
||||||
- POSTGRES_TAG
|
- POSTGRES_TAG
|
||||||
restart: unless-stopped
|
|
||||||
tty: true
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
- pg-data:${PGDATA}
|
- pg-data:${PGDATA}
|
||||||
@@ -41,14 +69,20 @@ services:
|
|||||||
- POSTGRES_USER
|
- POSTGRES_USER
|
||||||
- POSTGRES_PASSWORD
|
- POSTGRES_PASSWORD
|
||||||
- PGDATA
|
- PGDATA
|
||||||
|
- DB_USER
|
||||||
|
- DB_TEMPLATE
|
||||||
|
- UNACCENT_TEMPLATE
|
||||||
|
- PGADMING_DB_NAME
|
||||||
|
- PGADMING_DB_USER
|
||||||
|
- PGADMIN_DB_PASSWORD
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
profiles: [$POSTGRES_PROFILES]
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:${NGINX_TAG}
|
image: nginx:${NGINX_TAG}
|
||||||
depends_on:
|
depends_on:
|
||||||
- odoo
|
- odoo
|
||||||
restart: unless-stopped
|
|
||||||
tty: true
|
tty: true
|
||||||
expose:
|
expose:
|
||||||
- 80/tcp
|
- 80/tcp
|
||||||
@@ -62,32 +96,126 @@ services:
|
|||||||
- CORS_ALLOWED_DOMAIN
|
- CORS_ALLOWED_DOMAIN
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
profiles: [$NGINX_PROFILES]
|
||||||
|
|
||||||
nginx-proxy:
|
nginx-proxy:
|
||||||
image: nginxproxy/nginx-proxy:${NGINX_PROXY_TAG}
|
image: nginxproxy/nginx-proxy:${NGINX_PROXY_TAG}
|
||||||
depends_on:
|
depends_on:
|
||||||
- nginx
|
- nginx
|
||||||
restart: unless-stopped
|
|
||||||
tty: true
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx-proxy/nginx.conf:${NGINX_CONF}
|
- ./nginx-proxy/nginx.conf:${NGINX_CONF}
|
||||||
- ./nginx-proxy/cors.conf:${NGINX_PROXY_CORS_CONF}
|
- ./nginx-proxy/cors.conf:${NGINX_PROXY_CORS_CONF}
|
||||||
- certs:${NGINX_CERTS}:ro
|
|
||||||
- vhost:${NGINX_VHOST}
|
|
||||||
- html:${NGINX_HTML}
|
- html:${NGINX_HTML}
|
||||||
|
- vhost:${NGINX_VHOST}
|
||||||
|
- certs:${NGINX_CERTS}:ro
|
||||||
- ${DOCKER_SOCK}:${TEMP_DOCKER_SOCK}:ro
|
- ${DOCKER_SOCK}:${TEMP_DOCKER_SOCK}:ro
|
||||||
environment:
|
environment:
|
||||||
- TRUST_DOWNSTREAM_PROXY
|
- TRUST_DOWNSTREAM_PROXY
|
||||||
- CORS_ALLOWED_DOMAIN
|
- CORS_ALLOWED_DOMAIN
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
profiles: [$NGINX_PROXY_PROFILES]
|
||||||
|
|
||||||
|
letsencrypt:
|
||||||
|
image: nginxproxy/acme-companion:${ACME_COMPANION_TAG}
|
||||||
|
depends_on:
|
||||||
|
- nginx-proxy
|
||||||
|
volumes_from:
|
||||||
|
- nginx-proxy:rw
|
||||||
|
volumes:
|
||||||
|
- certs:${NGINX_CERTS}:rw
|
||||||
|
- acme:${NGINX_ACME}
|
||||||
|
- ${DOCKER_SOCK}:${DOCKER_SOCK}:ro
|
||||||
|
environment:
|
||||||
|
- ACME_CA_URI
|
||||||
|
- CERTS_UPDATE_INTERVAL
|
||||||
|
- DEFAULT_EMAIL
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
profiles: [$ACME_COMPANION_PROFILES]
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: eqalpha/keydb:${KEYDB_TAG}
|
||||||
|
platform: linux/amd64
|
||||||
|
ports:
|
||||||
|
- ${KEYDB_PORT}:${KEYDB_PORT}
|
||||||
|
volumes:
|
||||||
|
- redis-data:${KEYDB_DATA}
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
profiles: [$KEYDB_PROFILES]
|
||||||
|
|
||||||
|
s3:
|
||||||
|
image: minio/minio:${MINIO_TAG}
|
||||||
|
environment:
|
||||||
|
- MINIO_ROOT_USER
|
||||||
|
- MINIO_ROOT_PASSWORD
|
||||||
|
- MINIO_BROWSER_REDIRECT_URL
|
||||||
|
- VIRTUAL_HOST=${MINIO_VIRTUAL_HOST}
|
||||||
|
- VIRTUAL_PORT=${MINIO_CONSOLE_PORT}
|
||||||
|
command: server ${MINIO_DATA} --console-address ":${MINIO_CONSOLE_PORT}"
|
||||||
|
volumes:
|
||||||
|
- s3-data:${MINIO_DATA}
|
||||||
|
ports:
|
||||||
|
- ${MINIO_API_PORT}:${MINIO_API_PORT}
|
||||||
|
- ${MINIO_CONSOLE_PORT}:${MINIO_CONSOLE_PORT}
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
profiles: [$MINIO_PROFILES]
|
||||||
|
|
||||||
|
pgadmin:
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: ./pgadmin/Dockerfile
|
||||||
|
args:
|
||||||
|
- PGADMIN_TAG
|
||||||
|
depends_on:
|
||||||
|
- nginx-proxy
|
||||||
|
expose:
|
||||||
|
- 80
|
||||||
|
volumes:
|
||||||
|
- pgadmin-data:${PGADMIN_DATA}
|
||||||
|
environment:
|
||||||
|
- PGADMIN_DEFAULT_EMAIL
|
||||||
|
- PGADMIN_DEFAULT_PASSWORD
|
||||||
|
- VIRTUAL_HOST=${PGADMIN_VIRTUAL_HOST}
|
||||||
|
- LETSENCRYPT_HOST=${PGADMIN_LETSENCRYPT_HOST}
|
||||||
|
- LETSENCRYPT_EMAIL=${PGADMIN_LETSENCRYPT_EMAIL}
|
||||||
|
- PGADMIN_CONFIG_APP_NAME
|
||||||
|
- PGADMIN_CONFIG_CONFIG_DATABASE_CONNECTION_POOL_SIZE
|
||||||
|
- PGADMIN_CONFIG_SERVER_MODE
|
||||||
|
- PGADMIN_CONFIG_DEFAULT_SERVER
|
||||||
|
- PGADMIN_CONFIG_DEFAULT_SERVER_PORT
|
||||||
|
- PGADMIN_CONFIG_PASSWORD_LENGTH_MIN
|
||||||
|
- PGADMIN_CONFIG_MAX_SESSION_IDLE_TIME
|
||||||
|
- PGADMIN_CONFIG_CONFIG_DATABASE_URI
|
||||||
|
- PGADMIN_CONFIG_ALLOW_SAVE_PASSWORD
|
||||||
|
- PGADMIN_CONFIG_MAX_QUERY_HIST_STORED
|
||||||
|
- PGADMIN_CONFIG_MAIL_SERVER
|
||||||
|
- PGADMIN_CONFIG_MAIL_PORT
|
||||||
|
- PGADMIN_CONFIG_MAIL_USE_SSL
|
||||||
|
- PGADMIN_CONFIG_MAIL_USE_TLS
|
||||||
|
- PGADMIN_CONFIG_MAIL_USERNAME
|
||||||
|
- PGADMIN_CONFIG_MAIL_PASSWORD
|
||||||
|
- PGADMIN_CONFIG_MAIL_DEBUG
|
||||||
|
- PGADMIN_CONFIG_SECURITY_EMAIL_SENDER
|
||||||
|
- PGADMIN_CONFIG_ALLOW_SAVE_TUNNEL_PASSWORD
|
||||||
|
- PGADMIN_CONFIG_MAX_LOGIN_ATTEMPTS
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
profiles: [$PGADMIN_PROFILES]
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data-dir:
|
odoo-data:
|
||||||
pg-data:
|
pg-data:
|
||||||
certs:
|
redis-data:
|
||||||
vhost:
|
s3-data:
|
||||||
|
pgadmin-data:
|
||||||
html:
|
html:
|
||||||
|
vhost:
|
||||||
|
certs:
|
||||||
|
acme:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
internal:
|
internal:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ error_log /var/log/nginx/error.log notice;
|
|||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
worker_connections 10240;
|
worker_connections 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
@@ -27,7 +27,7 @@ http {
|
|||||||
proxy_read_timeout 900;
|
proxy_read_timeout 900;
|
||||||
send_timeout 900;
|
send_timeout 900;
|
||||||
|
|
||||||
client_max_body_size 1024m;
|
client_max_body_size 2048m;
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
include /etc/nginx/cors.conf;
|
include /etc/nginx/cors.conf;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ map $http_x_cors_allowed_domain $CORS_ALLOWED_DOMAIN {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
client_max_body_size 1024m;
|
client_max_body_size 2048m;
|
||||||
|
|
||||||
proxy_connect_timeout 900;
|
proxy_connect_timeout 900;
|
||||||
proxy_send_timeout 900;
|
proxy_send_timeout 900;
|
||||||
@@ -22,11 +22,12 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass http://odoo:8069;
|
proxy_pass http://odoo:8069;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
# Add CORS headers
|
# Add CORS headers
|
||||||
add_header 'Access-Control-Allow-Origin' $CORS_ALLOWED_DOMAIN;
|
add_header 'Access-Control-Allow-Origin' $CORS_ALLOWED_DOMAIN;
|
||||||
@@ -39,19 +40,14 @@ server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* /web/static/ {
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_pass http://odoo:8069;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /websocket {
|
location /websocket {
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header X-Forwarded-Host $host;
|
|
||||||
proxy_pass http://odoo:8072;
|
proxy_pass http://odoo:8072;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
106
odoo/Dockerfile
106
odoo/Dockerfile
@@ -11,75 +11,83 @@ USER root
|
|||||||
ARG ODOO_TAG
|
ARG ODOO_TAG
|
||||||
ARG ROOT_PATH
|
ARG ROOT_PATH
|
||||||
ARG LOG_PATH
|
ARG LOG_PATH
|
||||||
|
ARG ENTERPRISE_USER
|
||||||
|
ARG ENTERPRISE_ACCESS_TOKEN
|
||||||
|
ARG ENTERPRISE_ADDONS
|
||||||
ARG GITHUB_USER
|
ARG GITHUB_USER
|
||||||
ARG GITHUB_ACCESS_TOKEN
|
ARG GITHUB_ACCESS_TOKEN
|
||||||
ARG ENTERPRISE_ADDONS
|
ARG THIRD_PARTY_ADDONS
|
||||||
ARG ODOO_RC
|
ARG ODOO_RC
|
||||||
|
ARG USE_REDIS
|
||||||
|
ARG USE_S3
|
||||||
|
ARG USE_SENTRY
|
||||||
|
|
||||||
ENV ODOO_TAG=${ODOO_TAG} \
|
ENV ODOO_TAG=${ODOO_TAG} \
|
||||||
LOG_PATH=${LOG_PATH} \
|
LOG_PATH=${LOG_PATH} \
|
||||||
|
ENTERPRISE_USER=${ENTERPRISE_USER} \
|
||||||
|
ENTERPRISE_ACCESS_TOKEN=${ENTERPRISE_ACCESS_TOKEN} \
|
||||||
|
ENTERPRISE_ADDONS=${ENTERPRISE_ADDONS} \
|
||||||
GITHUB_USER=${GITHUB_USER} \
|
GITHUB_USER=${GITHUB_USER} \
|
||||||
GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN} \
|
GITHUB_ACCESS_TOKEN=${GITHUB_ACCESS_TOKEN} \
|
||||||
ENTERPRISE_ADDONS=${ENTERPRISE_ADDONS} \
|
THIRD_PARTY_ADDONS=${THIRD_PARTY_ADDONS} \
|
||||||
ODOO_RC=${ODOO_RC}
|
ODOO_RC=${ODOO_RC} \
|
||||||
|
USE_REDIS=${USE_REDIS} \
|
||||||
#------------------------#
|
USE_S3=${USE_S3} \
|
||||||
# APT Dependencies #
|
USE_SENTRY=${USE_SENTRY}
|
||||||
#------------------------#
|
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
apt-utils \
|
|
||||||
git \
|
|
||||||
git-man \
|
|
||||||
less \
|
|
||||||
libcbor0 \
|
|
||||||
libcurl3-gnutls \
|
|
||||||
libedit2 \
|
|
||||||
liberror-perl \
|
|
||||||
libxmuu1 \
|
|
||||||
openssh-client \
|
|
||||||
patch \
|
|
||||||
xauth \
|
|
||||||
# Clean up the apt cache to reduce the image size
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
#-----------------------#
|
|
||||||
# Odoo Enterprise #
|
|
||||||
#-----------------------#
|
|
||||||
|
|
||||||
# Create Enterprise addons directory
|
|
||||||
RUN mkdir -p ${ENTERPRISE_ADDONS} && \
|
|
||||||
chown odoo:odoo -R ${ENTERPRISE_ADDONS}
|
|
||||||
|
|
||||||
# Clone Enterprise addons if user and token are present
|
|
||||||
RUN if [ -n "$GITHUB_USER" ] && [ -n "$GITHUB_ACCESS_TOKEN" ]; then \
|
|
||||||
git clone https://${GITHUB_USER}:${GITHUB_ACCESS_TOKEN}@github.com/odoo/enterprise.git ${ENTERPRISE_ADDONS} --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
#---------------------#
|
|
||||||
# PIP Dependecies #
|
|
||||||
#---------------------#
|
|
||||||
# Upgrade pip
|
|
||||||
RUN pip3 install --upgrade pip
|
|
||||||
|
|
||||||
# Copy & Install PIP requirements
|
|
||||||
COPY --chown=odoo:odoo ./odoo/requirements.txt /tmp/requirements.txt
|
|
||||||
|
|
||||||
RUN python3 -m pip install --upgrade -r /tmp/requirements.txt && \
|
|
||||||
rm /tmp/requirements.txt
|
|
||||||
|
|
||||||
#---------------------#
|
#---------------------#
|
||||||
# Logging #
|
# Logging #
|
||||||
#---------------------#
|
#---------------------#
|
||||||
|
|
||||||
# Create odoo.log file
|
# Create odoo.log file
|
||||||
RUN touch ${LOG_PATH} && chown odoo:odoo ${LOG_PATH}
|
RUN touch ${LOG_PATH} && chown odoo:odoo ${LOG_PATH}
|
||||||
|
|
||||||
|
#------------------------#
|
||||||
|
# APT Dependencies #
|
||||||
|
#------------------------#
|
||||||
|
# Install Odoocker image dependencies
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
# `zip` and `unzip` for filestore management
|
||||||
|
zip \
|
||||||
|
unzip \
|
||||||
|
# `git` required packages
|
||||||
|
git \
|
||||||
|
git-man \
|
||||||
|
less \
|
||||||
|
libcbor0.8 \
|
||||||
|
libcurl3-gnutls \
|
||||||
|
libedit2 \
|
||||||
|
liberror-perl \
|
||||||
|
libfido2-1 \
|
||||||
|
libxmuu1 \
|
||||||
|
openssh-client \
|
||||||
|
patch \
|
||||||
|
xauth \
|
||||||
|
# Remove apt lists
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
#---------------------#
|
||||||
|
# PIP Dependecies #
|
||||||
|
#---------------------#
|
||||||
|
# Copy & Install PIP requirements
|
||||||
|
COPY --chown=odoo:odoo ./odoo/requirements.txt /tmp/requirements.txt
|
||||||
|
|
||||||
|
RUN python3 -m pip install -r /tmp/requirements.txt && \
|
||||||
|
rm /tmp/requirements.txt
|
||||||
|
|
||||||
|
#--------------------------------------------#
|
||||||
|
# Odoo Enterprise + Third Party Addons #
|
||||||
|
#--------------------------------------------#
|
||||||
|
# Create third-party-addons directory and clone them
|
||||||
|
COPY --chown=odoo:odoo ./odoo/clone-addons.sh /
|
||||||
|
COPY --chown=odoo:odoo ./odoo/third-party-addons.txt /
|
||||||
|
RUN /clone-addons.sh
|
||||||
|
|
||||||
#-----------------------#
|
#-----------------------#
|
||||||
# Odoo Conf #
|
# Odoo Conf #
|
||||||
#-----------------------#
|
#-----------------------#
|
||||||
|
|
||||||
# Copy environment variables & script to generate odoo.conf
|
# Copy environment variables & script to generate odoo.conf
|
||||||
COPY --chown=odoo:odoo ./.env /
|
COPY --chown=odoo:odoo ./.env /
|
||||||
|
COPY --chown=odoo:odoo ./odoo/odoo.conf /
|
||||||
COPY --chown=odoo:odoo ./odoo/odoorc.sh /
|
COPY --chown=odoo:odoo ./odoo/odoorc.sh /
|
||||||
|
|
||||||
# Generate odoo.conf
|
# Generate odoo.conf
|
||||||
|
|||||||
91
odoo/clone-addons.sh
Executable file
91
odoo/clone-addons.sh
Executable file
@@ -0,0 +1,91 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Function to construct the clone command
|
||||||
|
construct_clone_command() {
|
||||||
|
local repo_type=$1
|
||||||
|
local repo_url=$2
|
||||||
|
case $repo_type in
|
||||||
|
private) echo "git clone https://${GITHUB_USER}:${GITHUB_ACCESS_TOKEN}@${repo_url#https://}" ;;
|
||||||
|
enterprise) echo "git clone https://${ENTERPRISE_USER}:${ENTERPRISE_ACCESS_TOKEN}@${repo_url#https://} ${ENTERPRISE_ADDONS}" ;;
|
||||||
|
public) echo "git clone $repo_url" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to clone and copy modules based on conditions
|
||||||
|
clone_and_copy_modules() {
|
||||||
|
local repo_type=$1
|
||||||
|
local repo_url=$2
|
||||||
|
local clone_cmd=$(construct_clone_command $repo_type $repo_url)
|
||||||
|
local repo_name=$(basename -s .git "$repo_url")
|
||||||
|
|
||||||
|
shift 2
|
||||||
|
local modules_conditions=("$@")
|
||||||
|
|
||||||
|
# Clone and copy logic for enterprise repository
|
||||||
|
if [[ $repo_type == "enterprise" ]]; then
|
||||||
|
if [ -n "$GITHUB_USER" ] && [ -n "$GITHUB_ACCESS_TOKEN" ]; then
|
||||||
|
$clone_cmd --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Determine if any module has a true condition
|
||||||
|
local should_clone=false
|
||||||
|
if [[ ${#modules_conditions[@]} -eq 1 ]]; then
|
||||||
|
[[ ${modules_conditions[0]} == true ]] && should_clone=true
|
||||||
|
else
|
||||||
|
for (( i=1; i<${#modules_conditions[@]}; i+=2 )); do
|
||||||
|
if [[ ${modules_conditions[i]} == true ]]; then
|
||||||
|
should_clone=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clone the repo if should_clone is true and it's not already cloned
|
||||||
|
if [[ $should_clone == true && ! -d "$repo_name" ]]; then
|
||||||
|
$clone_cmd --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy the modules if the condition is true
|
||||||
|
if [[ $should_clone == true ]]; then
|
||||||
|
for (( i=0; i<${#modules_conditions[@]}; i+=2 )); do
|
||||||
|
local module=${modules_conditions[i]}
|
||||||
|
local condition=${modules_conditions[i+1]}
|
||||||
|
if [[ $condition == true ]]; then
|
||||||
|
echo "Copying ${module} from ${repo_name} into ${THIRD_PARTY_ADDONS}"
|
||||||
|
cp -r /${repo_name}/${module} ${THIRD_PARTY_ADDONS}/${module}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to manually expand environment variables in a string
|
||||||
|
expand_env_vars() {
|
||||||
|
while IFS=' ' read -r -a words; do
|
||||||
|
for word in "${words[@]}"; do
|
||||||
|
if [[ $word == \$\{* ]]; then
|
||||||
|
# Remove the leading '${' and the trailing '}' from the word
|
||||||
|
varname=${word:2:-1}
|
||||||
|
# Check if the variable is set and not empty
|
||||||
|
if [ -n "${!varname+x}" ]; then
|
||||||
|
echo -n "${!varname} " # Substitute with its value
|
||||||
|
else
|
||||||
|
echo -n "false " # Default to false if not set
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -n "$word "
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
done <<< "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Read the configuration file and process each line
|
||||||
|
while IFS= read -r line; do
|
||||||
|
mkdir -p ${ENTERPRISE_ADDONS}
|
||||||
|
mkdir -p ${THIRD_PARTY_ADDONS}
|
||||||
|
[[ -z "$line" || "$line" == \#* ]] && continue
|
||||||
|
clone_and_copy_modules $(expand_env_vars "$line")
|
||||||
|
done < "third-party-addons.txt"
|
||||||
@@ -2,6 +2,34 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
while IFS='=' read -r key value || [[ -n $key ]]; do
|
||||||
|
# Skip comments and empty lines
|
||||||
|
[[ $key =~ ^#.* ]] || [[ -z $key ]] && continue
|
||||||
|
|
||||||
|
# Removing any quotes around the value
|
||||||
|
value=${value%\"}
|
||||||
|
value=${value#\"}
|
||||||
|
|
||||||
|
# Declare variable
|
||||||
|
eval "$key=\"$value\""
|
||||||
|
done < .env
|
||||||
|
|
||||||
|
# Check the USE_REDIS to add base_attachment_object_storage & session_redis to LOAD variable
|
||||||
|
if [[ $USE_REDIS == "true" ]]; then
|
||||||
|
LOAD+=",session_redis"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check the USE_REDIS to add attachment_s3 to LOAD variable
|
||||||
|
if [[ $USE_S3 == "true" ]]; then
|
||||||
|
LOAD+=",base_attachment_object_storage"
|
||||||
|
LOAD+=",attachment_s3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check the USE_REDIS to add sentry to LOAD variable
|
||||||
|
if [[ $USE_SENTRY == "true" ]]; then
|
||||||
|
LOAD+=",sentry"
|
||||||
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-- | odoo)
|
-- | odoo)
|
||||||
shift
|
shift
|
||||||
@@ -9,27 +37,20 @@ case "$1" in
|
|||||||
# Creates new module.
|
# Creates new module.
|
||||||
exec odoo "$@"
|
exec odoo "$@"
|
||||||
else
|
else
|
||||||
wait-for-psql.py --db_host ${DB_HOST} --db_port ${DB_PORT} --db_user ${DB_USER} --db_password ${DB_PASSWORD} --timeout=30
|
wait-for-psql.py --db_host ${HOST} --db_port ${PORT} --db_user ${USER} --db_password ${PASSWORD} --timeout=30
|
||||||
|
|
||||||
if [ ${APP_ENV} = 'fresh' ] || [ ${APP_ENV} = 'restore' ]; then
|
if [ ${APP_ENV} = 'fresh' ] || [ ${APP_ENV} = 'restore' ]; then
|
||||||
# Ideal for a fresh install or restore a production database.
|
# Ideal for a fresh install or restore a production database.
|
||||||
echo odoo --config ${ODOO_RC} --database= --init= --update= --load=${SERVER_WIDE_MODULES} --log-level=${LOG_LEVEL} --load-language= --workers=0 --limit-time-cpu=3600 --limit-time-real=7200
|
echo odoo --config ${ODOO_RC} --database= --init= --update= --load=${LOAD} --log-level=${LOG_LEVEL} --load-language= --workers=0 --limit-time-cpu=3600 --limit-time-real=7200
|
||||||
|
|
||||||
exec odoo --config ${ODOO_RC} --database= --init= --update= --load-language= --workers=0 --limit-time-cpu=3600 --limit-time-real=7200
|
exec odoo --config ${ODOO_RC} --database= --init= --update= --load-language= --workers=0 --limit-time-cpu=3600 --limit-time-real=7200
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${APP_ENV} = 'full' ] ; then
|
|
||||||
# Ideal for initializing a fresh database with a huge amount of addons.
|
|
||||||
echo odoo --config ${ODOO_RC} --database=${DB_NAME} --init=${INIT} --update= --load=${SERVER_WIDE_MODULES} --log-level=${LOG_LEVEL} --load-language=${LOAD_LANGUAGE} --max-cron-threads=${MAX_CRON_THREADS} --limit-time-cpu=3600 --limit-time-real=7200
|
|
||||||
|
|
||||||
exec odoo --config ${ODOO_RC} --update= --workers=0 --limit-time-cpu=3600 --limit-time-real=7200
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ${APP_ENV} = 'local' ] ; then
|
if [ ${APP_ENV} = 'local' ] ; then
|
||||||
# Listens to all .env variables mapped into odoo.conf file.
|
# Listens to all .env variables mapped into odoo.conf file.
|
||||||
echo odoo --config ${ODOO_RC}
|
echo odoo --config ${ODOO_RC} --database=${DB_NAME} --init=${INIT} --update=${UPDATE} --load=${LOAD} --workers=${WORKERS} --log-level=${LOG_LEVEL} --dev=${DEV_MODE}
|
||||||
|
|
||||||
exec odoo --config ${ODOO_RC}
|
exec odoo --config ${ODOO_RC} --init=${INIT} --update=${UPDATE} --dev=${DEV_MODE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${APP_ENV} = 'debug' ] ; then
|
if [ ${APP_ENV} = 'debug' ] ; then
|
||||||
@@ -41,29 +62,29 @@ case "$1" in
|
|||||||
|
|
||||||
if [ ${APP_ENV} = 'testing' ] ; then
|
if [ ${APP_ENV} = 'testing' ] ; then
|
||||||
# Initializies a fresh 'test_*' database, installs the addons to test, and runs tests you specify in the test tags.
|
# Initializies a fresh 'test_*' database, installs the addons to test, and runs tests you specify in the test tags.
|
||||||
echo odoo --config ${ODOO_RC} --database=test_${DB_NAME} --test-enable --test-tags ${TEST_TAGS} --init=${ADDONS_TO_TEST} --update=${ADDONS_TO_TEST} --load=${SERVER_WIDE_MODULES} --log-level=${LOG_LEVEL} --without-demo= --workers=0 --stop-after-init
|
echo odoo --config ${ODOO_RC} --database=test_${DB_NAME} --test-enable --test-tags ${TEST_TAGS} --init=${ADDONS_TO_TEST} --update=${ADDONS_TO_TEST} --load=${LOAD} --log-level=${LOG_LEVEL} --without-demo= --workers=0 --dev= --stop-after-init
|
||||||
|
|
||||||
exec odoo --config ${ODOO_RC} --database=test_${DB_NAME} --test-enable --test-tags ${TEST_TAGS} --init=${ADDONS_TO_TEST} --update=${ADDONS_TO_TEST} --without-demo= --workers=0 --stop-after-init
|
exec odoo --config ${ODOO_RC} --database=test_${DB_NAME} --test-enable --test-tags ${TEST_TAGS} --init=${ADDONS_TO_TEST} --update=${ADDONS_TO_TEST} --without-demo= --workers=0 --dev= --stop-after-init
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${APP_ENV} = 'staging' ] ; then
|
if [ ${APP_ENV} = 'staging' ] ; then
|
||||||
# Automagically upgrade all addons and install new ones. Ideal for deployment process.
|
# Automagically upgrade all addons and install new ones. Ideal for deployment process.
|
||||||
echo odoo --config ${ODOO_RC} --database=${DB_NAME} --init=${INIT} --update=all --load=${SERVER_WIDE_MODULES} --log-level=${LOG_LEVEL} --load-language=${LOAD_LANGUAGE} --limit-time-cpu=3600 --limit-time-real=7200
|
echo odoo --config ${ODOO_RC} --database=${DB_NAME} --init=${INIT} --update=all --load=${LOAD} --log-level=${LOG_LEVEL} --load-language=${LOAD_LANGUAGE} --limit-time-cpu=3600 --limit-time-real=7200 --dev=
|
||||||
|
|
||||||
exec odoo --config ${ODOO_RC} --update=all --without-demo=all --workers=0 --limit-time-cpu=3600 --limit-time-real=7200
|
exec odoo --config ${ODOO_RC} --database=${DB_NAME} --init=${INIT} --update=all --without-demo=all --workers=0 --limit-time-cpu=3600 --limit-time-real=7200 --dev=
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${APP_ENV} = 'production' ] ; then
|
if [ ${APP_ENV} = 'production' ] ; then
|
||||||
# Bring up Odoo ready for production.
|
# Bring up Odoo ready for production.
|
||||||
echo odoo --config ${ODOO_RC} --database= --init= --update= --load=${SERVER_WIDE_MODULES} --workers=${WORKERS} --log-level=${LOG_LEVEL} --load-language= --without-demo=all --dev=
|
echo odoo --config ${ODOO_RC} --database= --init=${INIT} --update=${UPDATE} --load=${LOAD} --workers=${WORKERS} --log-level=${LOG_LEVEL} --without-demo=${WITHOUT_DEMO} --load-language= --dev=
|
||||||
|
|
||||||
exec odoo --config ${ODOO_RC} --database= --init= --update= --load-language= --without-demo=all --dev=
|
exec odoo --config ${ODOO_RC} --database= --init=${INIT} --update=${UPDATE} --load-language= --dev=
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
-*)
|
-*)
|
||||||
|
|
||||||
wait-for-psql.py --db_host ${DB_HOST} --db_port ${DB_PORT} --db_user ${DB_USER} --db_password ${DB_PASSWORD} --timeout=30
|
wait-for-psql.py --db_host ${HOST} --db_port ${PORT} --db_user ${USER} --db_password ${PASSWORD} --timeout=30
|
||||||
echo odoo --config ${ODOO_RC}
|
echo odoo --config ${ODOO_RC}
|
||||||
exec odoo --config ${ODOO_RC}
|
exec odoo --config ${ODOO_RC}
|
||||||
;;
|
;;
|
||||||
|
|||||||
2
odoo/extra-addons/DELETE_ME.txt
Normal file
2
odoo/extra-addons/DELETE_ME.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Delete me once you add your first extra addon :)
|
||||||
|
This folder is made for addons that are not clonable via GitHub.
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
'name': 'Report URL',
|
|
||||||
'summary': 'Adds Report URL to Odoo Container',
|
|
||||||
'description': '''
|
|
||||||
Odoo Containers doesn't come with report.url param out of the box, so we add it for you to work with Odoocker.
|
|
||||||
''',
|
|
||||||
'version': '1.0.0',
|
|
||||||
'category': 'Technical',
|
|
||||||
'license': 'LGPL-3',
|
|
||||||
'author': 'Odoocker',
|
|
||||||
'maintainer': 'Odoocker',
|
|
||||||
'contributors': [
|
|
||||||
'Yhael S <yhaelopez@gmail.com>'
|
|
||||||
],
|
|
||||||
'depends': [
|
|
||||||
'base'
|
|
||||||
],
|
|
||||||
'data': [
|
|
||||||
'data/ir_config_parameter.xml'
|
|
||||||
],
|
|
||||||
'application': False,
|
|
||||||
'installable': True,
|
|
||||||
'auto_install': True
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<odoo>
|
|
||||||
<!-- When initializing Odoo through Docker this parameter is missing. -->
|
|
||||||
<record id="report_url" model="ir.config_parameter">
|
|
||||||
<field name="key">report.url</field>
|
|
||||||
<field name="value">http://127.0.0.1:8069</field>
|
|
||||||
</record>
|
|
||||||
</odoo>
|
|
||||||
@@ -48,6 +48,11 @@
|
|||||||
# ... other qweb templates
|
# ... other qweb templates
|
||||||
],
|
],
|
||||||
'assets': {
|
'assets': {
|
||||||
|
'web.assets_frontend': [
|
||||||
|
'module_name/static/src/js/file.js',
|
||||||
|
'module_name/static/src/css/style.css'
|
||||||
|
# ... other assets
|
||||||
|
],
|
||||||
'web.assets_backend': [
|
'web.assets_backend': [
|
||||||
'module_name/static/src/js/file.js',
|
'module_name/static/src/js/file.js',
|
||||||
'module_name/static/src/css/style.css'
|
'module_name/static/src/css/style.css'
|
||||||
326
odoo/odoo.conf
Normal file
326
odoo/odoo.conf
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
[options]
|
||||||
|
;------------------------------------------;
|
||||||
|
; Options not exposed on the command line. ;
|
||||||
|
;------------------------------------------;
|
||||||
|
|
||||||
|
admin_passwd = ${ADMIN_PASSWD}
|
||||||
|
csv_internal_sep = ${CSV_INTERNAL_SEP}
|
||||||
|
publisher_warranty_url = ${PUBLISHER_WARRANTY_URL}
|
||||||
|
root_path = ${ROOT_PATH}
|
||||||
|
reportgz = ${REPORTGZ}
|
||||||
|
websocket_keep_alive_timeout = ${WEBSOCKET_KEEP_ALIVE_TIMEOUT}
|
||||||
|
websocket_rate_limit_burst = ${WEBSOCKET_RATE_LIMIT_BURST}
|
||||||
|
websocket_rate_limit_delay = ${WEBSOCKET_RATE_LIMIT_DELAY}
|
||||||
|
|
||||||
|
;-----------------------;
|
||||||
|
; Server startup config ;
|
||||||
|
;-----------------------;
|
||||||
|
; --config | -c
|
||||||
|
config = ${ODOO_RC}
|
||||||
|
|
||||||
|
; --save
|
||||||
|
save = ${SAVE}
|
||||||
|
|
||||||
|
; --init | -i
|
||||||
|
init = ${INIT}
|
||||||
|
|
||||||
|
; --update | -u
|
||||||
|
update = ${UPDATE}
|
||||||
|
|
||||||
|
; --without-demo
|
||||||
|
demo = ${DEMO}
|
||||||
|
without_demo = ${WITHOUT_DEMO}
|
||||||
|
|
||||||
|
; --import-partial
|
||||||
|
import_partial = ${IMPORT_PARTIAL}
|
||||||
|
|
||||||
|
; --pidfile
|
||||||
|
pidfile = ${PIDFILE}
|
||||||
|
|
||||||
|
; --addons-path
|
||||||
|
addons_path = ${ADDONS_PATH}
|
||||||
|
|
||||||
|
; --upgrade-path
|
||||||
|
upgrade_path = ${UPGRADE_PATH}
|
||||||
|
|
||||||
|
; --load
|
||||||
|
server_wide_modules = ${LOAD}
|
||||||
|
|
||||||
|
; --data-dir
|
||||||
|
data_dir = ${DATA_DIR}
|
||||||
|
|
||||||
|
;------;
|
||||||
|
; HTTP ;
|
||||||
|
;------;
|
||||||
|
; --http-interface | --xmlrpc-interface
|
||||||
|
http_interface = ${HTTP_INTERFACE}
|
||||||
|
|
||||||
|
; --http-port | -p | --xmlrpc-port
|
||||||
|
http_port = ${HTTP_PORT}
|
||||||
|
|
||||||
|
; --xmlrpcs-interface
|
||||||
|
xmlrpcs_interface = ${XMLRPCS_INTERFACE}
|
||||||
|
|
||||||
|
; --xmlrpcs-port
|
||||||
|
xmlrpcs_port = ${XMLRPCS_PORT}
|
||||||
|
|
||||||
|
; --gevent-port
|
||||||
|
gevent_port = ${GEVENT_PORT}
|
||||||
|
|
||||||
|
; --no-http | --no-xmlrpc
|
||||||
|
http_enable = ${HTTP_ENABLE}
|
||||||
|
|
||||||
|
; --no-xmlrpcs
|
||||||
|
xmlrpcs = ${XMLRPCS}
|
||||||
|
|
||||||
|
; --proxy-mode
|
||||||
|
proxy_mode = ${PROXY_MODE}
|
||||||
|
|
||||||
|
; --x-sendfile
|
||||||
|
x_sendfile = ${X_SENDFILE}
|
||||||
|
|
||||||
|
;---------------;
|
||||||
|
; Testing Group ;
|
||||||
|
;---------------;
|
||||||
|
; --test-file
|
||||||
|
test_file = ${TEST_FILE}
|
||||||
|
|
||||||
|
; --test-enable
|
||||||
|
test_enable = ${TEST_ENABLE}
|
||||||
|
|
||||||
|
; --test-tags
|
||||||
|
test_tags = ${TEST_FILE}
|
||||||
|
|
||||||
|
; --screencasts
|
||||||
|
screencasts = ${SCREENCASTS}
|
||||||
|
|
||||||
|
; --screenshots
|
||||||
|
screenshots = ${SCREENSHOTS}
|
||||||
|
|
||||||
|
;---------------;
|
||||||
|
; Logging Group ;
|
||||||
|
;---------------;
|
||||||
|
; --logfile
|
||||||
|
logfile = ${LOGFILE}
|
||||||
|
|
||||||
|
; --syslog
|
||||||
|
syslog = ${SYSLOG}
|
||||||
|
|
||||||
|
; --log-handler | --log-web (--log-handler=odoo.http:DEBUG) | --log-sql (--log-handler=odoo.sql_db:DEBUG)
|
||||||
|
log_handler = ${LOG_HANDLER}
|
||||||
|
|
||||||
|
; --log-db
|
||||||
|
log_db = ${LOG_DB}
|
||||||
|
|
||||||
|
; --log-db-level
|
||||||
|
log_db_level = ${LOG_DB_LEVEL}
|
||||||
|
|
||||||
|
; --log-level
|
||||||
|
log_level = ${LOG_LEVEL}
|
||||||
|
|
||||||
|
;------------;
|
||||||
|
; SMTP Group ;
|
||||||
|
;------------;
|
||||||
|
; --email-from
|
||||||
|
email_from = ${EMAIL_FROM}
|
||||||
|
|
||||||
|
; --from-filter
|
||||||
|
from_filter = ${FROM_FILTER}
|
||||||
|
|
||||||
|
; --smtp
|
||||||
|
smtp_server = ${SMTP_SERVER}
|
||||||
|
|
||||||
|
; --smtp-port
|
||||||
|
smtp_port = ${SMTP_PORT}
|
||||||
|
|
||||||
|
; --smtp-ssl
|
||||||
|
smtp_ssl = ${SMTP_SSL}
|
||||||
|
|
||||||
|
; --smtp-user
|
||||||
|
smtp_user = ${SMTP_USER}
|
||||||
|
|
||||||
|
; --smtp-password
|
||||||
|
smtp_password = ${SMTP_PASSWORD}
|
||||||
|
|
||||||
|
; --smtp-ssl-certificate-filename
|
||||||
|
smtp_ssl_certificate_filename = ${SMTP_SSL_CERTIFICATE_FILENAME}
|
||||||
|
|
||||||
|
; --smtp-ssl-private-key-filename
|
||||||
|
smtp_ssl_private_key_filename = ${SMTP_SSL_PRIVATE_KEY_FILENAME}
|
||||||
|
|
||||||
|
;----------;
|
||||||
|
; DB Group ;
|
||||||
|
;----------;
|
||||||
|
; --database | -d
|
||||||
|
db_name = ${DB_NAME}
|
||||||
|
|
||||||
|
; --db_user | -r
|
||||||
|
db_user = ${DB_USER}
|
||||||
|
|
||||||
|
; --db_password | -w
|
||||||
|
db_password = ${DB_PASSWORD}
|
||||||
|
|
||||||
|
; --pg_path
|
||||||
|
pg_path = ${PG_PATH}
|
||||||
|
|
||||||
|
; --db_host
|
||||||
|
db_host = ${DB_HOST}
|
||||||
|
|
||||||
|
; --db_port
|
||||||
|
db_port = ${DB_PORT}
|
||||||
|
|
||||||
|
; --db_sslmode
|
||||||
|
db_sslmode = ${DB_SSLMODE}
|
||||||
|
|
||||||
|
; --db_maxconn
|
||||||
|
db_maxconn = ${DB_MAXCONN}
|
||||||
|
|
||||||
|
; --db-template
|
||||||
|
db_template = ${DB_TEMPLATE}
|
||||||
|
|
||||||
|
;------------------------------;
|
||||||
|
; Internationalisation options ;
|
||||||
|
;------------------------------;
|
||||||
|
; --load-language
|
||||||
|
load_language = ${LOAD_LANGUAGE}
|
||||||
|
|
||||||
|
; --language
|
||||||
|
language = ${LANGUAGE}
|
||||||
|
|
||||||
|
; --i18n-export
|
||||||
|
translate_out = ${TRANSLATE_OUT}
|
||||||
|
|
||||||
|
; --i18n-import
|
||||||
|
translate_in = ${TRANSLATE_IN}
|
||||||
|
|
||||||
|
; --i18n-overwrite
|
||||||
|
overwrite_existing_translations = ${OVERWRITE_EXISTING_TRANSLATIONS}
|
||||||
|
|
||||||
|
; --modules
|
||||||
|
translate_modules = ${TRANSLATE_MODULES}
|
||||||
|
|
||||||
|
;----------;
|
||||||
|
; Security ;
|
||||||
|
;----------;
|
||||||
|
; --no-database-list
|
||||||
|
list_db = ${LIST_DB}
|
||||||
|
|
||||||
|
;-----;
|
||||||
|
; WEB ;
|
||||||
|
;-----;
|
||||||
|
; --db-filter
|
||||||
|
dbfilter = ${DBFILTER}
|
||||||
|
|
||||||
|
;------------------;
|
||||||
|
; Advanced options ;
|
||||||
|
;------------------;
|
||||||
|
; --dev (all, reload, xml, qweb, werkzeug, sql, shell, assets, tests)
|
||||||
|
dev_mode = ${DEV_MODE}
|
||||||
|
|
||||||
|
; --shell-interface
|
||||||
|
shell_interface = ${SHELL_INTERFACE}
|
||||||
|
|
||||||
|
; --stop-after-init
|
||||||
|
stop_after_init = ${STOP_AFTER_INIT}
|
||||||
|
|
||||||
|
; --osv-memory-count-limit
|
||||||
|
osv_memory_count_limit = ${OSV_MEMORY_COUNT_LIMIT}
|
||||||
|
|
||||||
|
; --transient-age-limit
|
||||||
|
transient_age_limit = ${TRANSIENT_AGE_LIMIT}
|
||||||
|
|
||||||
|
; --max-cron-threads
|
||||||
|
max_cron_threads = ${MAX_CRON_THREADS}
|
||||||
|
|
||||||
|
; --unaccent
|
||||||
|
unaccent = ${UNACCENT}
|
||||||
|
|
||||||
|
; --geoip-db
|
||||||
|
geoip_database = ${GEOIP_DATABASE}
|
||||||
|
|
||||||
|
; --workers
|
||||||
|
workers = ${WORKERS}
|
||||||
|
|
||||||
|
; --limit-memory-soft
|
||||||
|
limit_memory_soft = ${LIMIT_MEMORY_SOFT}
|
||||||
|
|
||||||
|
; --limit-memory-hard
|
||||||
|
limit_memory_hard = ${LIMIT_MEMORY_HARD}
|
||||||
|
|
||||||
|
; --limit-time-cpu
|
||||||
|
limit_time_cpu = ${LIMIT_TIME_CPU}
|
||||||
|
|
||||||
|
; --limit-time-real
|
||||||
|
limit_time_real = ${LIMIT_TIME_REAL}
|
||||||
|
|
||||||
|
; --limit-time-real-cron
|
||||||
|
limit_time_real_cron = ${LIMIT_TIME_REAL_CRON}
|
||||||
|
|
||||||
|
; --limit-request
|
||||||
|
limit_request = ${LIMIT_REQUEST}
|
||||||
|
|
||||||
|
;-----------------------------;
|
||||||
|
; External Integrations ;
|
||||||
|
;-----------------------------;
|
||||||
|
|
||||||
|
;--------------;
|
||||||
|
; Sentry ;
|
||||||
|
;--------------;
|
||||||
|
sentry_dsn = ${SENTRY_DSN}
|
||||||
|
sentry_enabled = ${SENTRY_ENABLED}
|
||||||
|
sentry_logging_level = ${SENTRY_LOGGING_LEVEL}
|
||||||
|
sentry_exclude_loggers = ${SENTRY_EXCLUDE_LOGGERS}
|
||||||
|
sentry_ignore_exceptions = ${SENTRY_IGNORE_EXCEPTIONS}
|
||||||
|
sentry_include_context = ${SENTRY_INCLUDE_CONTEXT}
|
||||||
|
sentry_environment = ${SENTRY_ENVIRONMENT}
|
||||||
|
sentry_release = ${SENTRY_RELEASE}
|
||||||
|
sentry_odoo_dir = ${SENTRY_ODOO_DIR}
|
||||||
|
|
||||||
|
;-------------;
|
||||||
|
; Redis ;
|
||||||
|
;-------------;
|
||||||
|
; -- Possible values: 1 or true
|
||||||
|
ODOO_SESSION_REDIS = ${ODOO_SESSION_REDIS}
|
||||||
|
|
||||||
|
; -- Defaults to is localhost
|
||||||
|
ODOO_SESSION_REDIS_HOST = ${ODOO_SESSION_REDIS_HOST}
|
||||||
|
|
||||||
|
; -- Defaults to 6379
|
||||||
|
ODOO_SESSION_REDIS_PORT = ${ODOO_SESSION_REDIS_PORT}
|
||||||
|
|
||||||
|
; -- Sets the password for the AUTH command (optional)
|
||||||
|
ODOO_SESSION_REDIS_PASSWORD = ${ODOO_SESSION_REDIS_PASSWORD}
|
||||||
|
|
||||||
|
; -- Alternative way to define the Redis server address like rediss:// protocol.
|
||||||
|
ODOO_SESSION_REDIS_URL = ${ODOO_SESSION_REDIS_URL}
|
||||||
|
|
||||||
|
; -- Prefix for the session keys (optional)
|
||||||
|
ODOO_SESSION_REDIS_PREFIX = ${ODOO_SESSION_REDIS_PREFIX}
|
||||||
|
|
||||||
|
; -- Time in seconds before expiration of the sessions (default is 7 days)
|
||||||
|
ODOO_SESSION_REDIS_EXPIRATION = ${ODOO_SESSION_REDIS_EXPIRATION}
|
||||||
|
|
||||||
|
; -- Time in seconds before expiration of the anonymous sessions (default is 3 hours)
|
||||||
|
ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS = ${ODOO_SESSION_REDIS_EXPIRATION_ANONYMOUS}
|
||||||
|
|
||||||
|
;--------------------------------------;
|
||||||
|
; Base Attachment Object Storage ;
|
||||||
|
;--------------------------------------;
|
||||||
|
; -- Disable Attachment Object Storage
|
||||||
|
DISABLE_ATTACHMENT_STORAGE = ${DISABLE_ATTACHMENT_STORAGE}
|
||||||
|
|
||||||
|
;----------;
|
||||||
|
; S3 ;
|
||||||
|
;----------;
|
||||||
|
; -- Not required if using AWS S3
|
||||||
|
AWS_HOST = ${AWS_HOST}
|
||||||
|
|
||||||
|
; -- Required if using AWS services
|
||||||
|
AWS_REGION = ${AWS_REGION}
|
||||||
|
|
||||||
|
; -- AWS Authentication
|
||||||
|
AWS_ACCESS_KEY_ID = ${AWS_ACCESS_KEY_ID}
|
||||||
|
AWS_SECRET_ACCESS_KEY = ${AWS_SECRET_ACCESS_KEY}
|
||||||
|
|
||||||
|
; Optional db_name placeholder
|
||||||
|
AWS_BUCKETNAME = ${AWS_BUCKETNAME}
|
||||||
@@ -1,261 +0,0 @@
|
|||||||
[options]
|
|
||||||
;------------------------------------------;
|
|
||||||
; Options not exposed on the command line. ;
|
|
||||||
;------------------------------------------;
|
|
||||||
|
|
||||||
admin_passwd = {ADMIN_PASSWD}
|
|
||||||
csv_internal_sep = {CSV_INTERNAL_SEP}
|
|
||||||
publisher_warranty_url = {PUBLISHER_WARRANTY_URL}
|
|
||||||
root_path = {ROOT_PATH}
|
|
||||||
reportgz = {REPORTGZ}
|
|
||||||
websocket_keep_alive_timeout = {WEBSOCKET_KEEP_ALIVE_TIMEOUT}
|
|
||||||
websocket_rate_limit_burst = {WEBSOCKET_RATE_LIMIT_BURST}
|
|
||||||
websocket_rate_limit_delay = {WEBSOCKET_RATE_LIMIT_DELAY}
|
|
||||||
|
|
||||||
;-----------------------;
|
|
||||||
; Server startup config ;
|
|
||||||
;-----------------------;
|
|
||||||
; --config | -c
|
|
||||||
config = {ODOO_RC}
|
|
||||||
|
|
||||||
; --save
|
|
||||||
save = {SAVE}
|
|
||||||
|
|
||||||
; --init | -i
|
|
||||||
init = {INIT}
|
|
||||||
|
|
||||||
; --update | -u
|
|
||||||
update = {UPDATE}
|
|
||||||
|
|
||||||
; --without-demo
|
|
||||||
demo = {DEMO}
|
|
||||||
without_demo = {WITHOUT_DEMO}
|
|
||||||
|
|
||||||
; --import-partial
|
|
||||||
import_partial = {IMPORT_PARTIAL}
|
|
||||||
|
|
||||||
; --pidfile
|
|
||||||
pidfile = {PIDFILE}
|
|
||||||
|
|
||||||
; --addons-path
|
|
||||||
addons_path = {ADDONS_PATH}
|
|
||||||
|
|
||||||
; --upgrade-path
|
|
||||||
upgrade_path = {UPGRADE_PATH}
|
|
||||||
|
|
||||||
; --load
|
|
||||||
server_wide_modules = {SERVER_WIDE_MODULES}
|
|
||||||
|
|
||||||
; --data-dir
|
|
||||||
data_dir = {DATA_DIR}
|
|
||||||
|
|
||||||
;------;
|
|
||||||
; HTTP ;
|
|
||||||
;------;
|
|
||||||
; --http-interface | --xmlrpc-interface
|
|
||||||
http_interface = {HTTP_INTERFACE}
|
|
||||||
|
|
||||||
; --http-port | -p | --xmlrpc-port
|
|
||||||
http_port = {HTTP_PORT}
|
|
||||||
|
|
||||||
; --xmlrpcs-interface
|
|
||||||
xmlrpcs_interface = {XMLRPCS_INTERFACE}
|
|
||||||
|
|
||||||
; --xmlrpcs-port
|
|
||||||
xmlrpcs_port = {XMLRPCS_PORT}
|
|
||||||
|
|
||||||
; --gevent-port | --longpolling_port (deprecated)
|
|
||||||
gevent_port = {GEVENT_PORT}
|
|
||||||
longpolling_port = False
|
|
||||||
|
|
||||||
; --no-http | --no-xmlrpc
|
|
||||||
http_enable = {HTTP_ENABLE}
|
|
||||||
|
|
||||||
; --no-xmlrpcs
|
|
||||||
xmlrpcs = {XMLRPCS}
|
|
||||||
|
|
||||||
; --proxy-mode
|
|
||||||
proxy_mode = {PROXY_MODE}
|
|
||||||
|
|
||||||
; --x-sendfile
|
|
||||||
x_sendfile = {X_SENDFILE}
|
|
||||||
|
|
||||||
;---------------;
|
|
||||||
; Testing Group ;
|
|
||||||
;---------------;
|
|
||||||
; --test-file
|
|
||||||
test_file = {TEST_FILE}
|
|
||||||
|
|
||||||
; --test-enable
|
|
||||||
test_enable = {TEST_ENABLE}
|
|
||||||
|
|
||||||
; --test-tags
|
|
||||||
test_tags = {TEST_FILE}
|
|
||||||
|
|
||||||
; --screencasts
|
|
||||||
screencasts = {SCREENCASTS}
|
|
||||||
|
|
||||||
; --screenshots
|
|
||||||
screenshots = {SCREENSHOTS}
|
|
||||||
|
|
||||||
;---------------;
|
|
||||||
; Logging Group ;
|
|
||||||
;---------------;
|
|
||||||
; --logfile
|
|
||||||
logfile = {LOGFILE}
|
|
||||||
|
|
||||||
; --syslog
|
|
||||||
syslog = {SYSLOG}
|
|
||||||
|
|
||||||
; --log-handler | --log-web (--log-handler=odoo.http:DEBUG) | --log-sql (--log-handler=odoo.sql_db:DEBUG)
|
|
||||||
log_handler = {LOG_HANDLER}
|
|
||||||
|
|
||||||
; --log-db
|
|
||||||
log_db = {LOG_DB}
|
|
||||||
|
|
||||||
; --log-db-level
|
|
||||||
log_db_level = {LOG_DB_LEVEL}
|
|
||||||
|
|
||||||
; --log-level
|
|
||||||
log_level = {LOG_LEVEL}
|
|
||||||
|
|
||||||
;------------;
|
|
||||||
; SMTP Group ;
|
|
||||||
;------------;
|
|
||||||
; --email-from
|
|
||||||
email_from = {EMAIL_FROM}
|
|
||||||
|
|
||||||
; --from-filter
|
|
||||||
from_filter = {FROM_FILTER}
|
|
||||||
|
|
||||||
; --smtp
|
|
||||||
smtp_server = {SMTP_SERVER}
|
|
||||||
|
|
||||||
; --smtp-port
|
|
||||||
smtp_port = {SMTP_PORT}
|
|
||||||
|
|
||||||
; --smtp-ssl
|
|
||||||
smtp_ssl = {SMTP_SSL}
|
|
||||||
|
|
||||||
; --smtp-user
|
|
||||||
smtp_user = {SMTP_USER}
|
|
||||||
|
|
||||||
; --smtp-password
|
|
||||||
smtp_password = {SMTP_PASSWORD}
|
|
||||||
|
|
||||||
; --smtp-ssl-certificate-filename
|
|
||||||
smtp_ssl_certificate_filename = {SMTP_SSL_CERTIFICATE_FILENAME}
|
|
||||||
|
|
||||||
; --smtp-ssl-private-key-filename
|
|
||||||
smtp_ssl_private_key_filename = {SMTP_SSL_PRIVATE_KEY_FILENAME}
|
|
||||||
|
|
||||||
;----------;
|
|
||||||
; DB Group ;
|
|
||||||
;----------;
|
|
||||||
; --database | -d
|
|
||||||
db_name = {DB_NAME}
|
|
||||||
|
|
||||||
; --db_user | -r
|
|
||||||
db_user = {DB_USER}
|
|
||||||
|
|
||||||
; --db_password | -w
|
|
||||||
db_password = {DB_PASSWORD}
|
|
||||||
|
|
||||||
; --pg_path
|
|
||||||
pg_path = {PG_PATH}
|
|
||||||
|
|
||||||
; --db_host
|
|
||||||
db_host = {DB_HOST}
|
|
||||||
|
|
||||||
; --db_port
|
|
||||||
db_port = {DB_PORT}
|
|
||||||
|
|
||||||
; --db_sslmode
|
|
||||||
db_sslmode = {DB_SSLMODE}
|
|
||||||
|
|
||||||
; --db_maxconn
|
|
||||||
db_maxconn = {DB_MAXCONN}
|
|
||||||
|
|
||||||
; --db-template
|
|
||||||
db_template = {DB_TEMPLATE}
|
|
||||||
|
|
||||||
;------------------------------;
|
|
||||||
; Internationalisation options ;
|
|
||||||
;------------------------------;
|
|
||||||
; --load-language
|
|
||||||
load_language = {LOAD_LANGUAGE}
|
|
||||||
|
|
||||||
; --language
|
|
||||||
language = {LANGUAGE}
|
|
||||||
|
|
||||||
; --i18n-export
|
|
||||||
translate_out = {TRANSLATE_OUT}
|
|
||||||
|
|
||||||
; --i18n-import
|
|
||||||
translate_in = {TRANSLATE_IN}
|
|
||||||
|
|
||||||
; --i18n-overwrite
|
|
||||||
overwrite_existing_translations = {OVERWRITE_EXISTING_TRANSLATIONS}
|
|
||||||
|
|
||||||
; --modules
|
|
||||||
translate_modules = {TRANSLATE_MODULES}
|
|
||||||
|
|
||||||
;----------;
|
|
||||||
; Security ;
|
|
||||||
;----------;
|
|
||||||
; --no-database-list
|
|
||||||
list_db = {LIST_DB}
|
|
||||||
|
|
||||||
;-----;
|
|
||||||
; WEB ;
|
|
||||||
;-----;
|
|
||||||
; --db-filter
|
|
||||||
dbfilter = {DBFILTER}
|
|
||||||
|
|
||||||
;------------------;
|
|
||||||
; Advanced options ;
|
|
||||||
;------------------;
|
|
||||||
; --dev (all, reload, qweb, werkzeug, sql, shell, assets, tests)
|
|
||||||
dev_mode = {DEV_MODE}
|
|
||||||
|
|
||||||
; --shell-interface
|
|
||||||
shell_interface = {SHELL_INTERFACE}
|
|
||||||
|
|
||||||
; --stop-after-init
|
|
||||||
stop_after_init = {STOP_AFTER_INIT}
|
|
||||||
|
|
||||||
; --osv-memory-count-limit
|
|
||||||
osv_memory_count_limit = {OSV_MEMORY_COUNT_LIMIT}
|
|
||||||
|
|
||||||
; --transient-age-limit | --osv-memory-age-limit (deprecated)
|
|
||||||
transient_age_limit = {TRANSIENT_AGE_LIMIT}
|
|
||||||
|
|
||||||
; --max-cron-threads
|
|
||||||
max_cron_threads = {MAX_CRON_THREADS}
|
|
||||||
|
|
||||||
; --unaccent
|
|
||||||
unaccent = {UNACCENT}
|
|
||||||
|
|
||||||
; --geoip-db
|
|
||||||
geoip_database = {GEOIP_DATABASE}
|
|
||||||
|
|
||||||
; --workers
|
|
||||||
workers = {WORKERS}
|
|
||||||
|
|
||||||
; --limit-memory-soft
|
|
||||||
limit_memory_soft = {LIMIT_MEMORY_SOFT}
|
|
||||||
|
|
||||||
; --limit-memory-hard
|
|
||||||
limit_memory_hard = {LIMIT_MEMORY_HARD}
|
|
||||||
|
|
||||||
; --limit-time-cpu
|
|
||||||
limit_time_cpu = {LIMIT_TIME_CPU}
|
|
||||||
|
|
||||||
; --limit-time-real
|
|
||||||
limit_time_real = {LIMIT_TIME_REAL}
|
|
||||||
|
|
||||||
; --limit-time-real-cron
|
|
||||||
limit_time_real_cron = {LIMIT_TIME_REAL_CRON}
|
|
||||||
|
|
||||||
; --limit-request
|
|
||||||
limit_request = {LIMIT_REQUEST}
|
|
||||||
414
odoo/odoorc.sh
414
odoo/odoorc.sh
@@ -2,379 +2,55 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Define default values for environment variables
|
# Define the path to the example configuration file
|
||||||
set -a
|
TEMPLATE_CONF="odoo.conf"
|
||||||
source /.env
|
|
||||||
set +a
|
|
||||||
|
|
||||||
declare -A defaults
|
# First pass: Evaluate any nested variables within .env file and export them
|
||||||
defaults=(
|
while IFS='=' read -r key value || [[ -n $key ]]; do
|
||||||
[ADMIN_PASSWD]=${ADMIN_PASSWD}
|
# Skip comments and empty lines
|
||||||
[CSV_INTERNAL_SEP]=${CSV_INTERNAL_SEP}
|
[[ $key =~ ^#.* ]] || [[ -z $key ]] && continue
|
||||||
[PUBLISHER_WARRANTY_URL]=${PUBLISHER_WARRANTY_URL}
|
|
||||||
[ROOT_PATH]=${ROOT_PATH}
|
|
||||||
[REPORTGZ]=${REPORTGZ}
|
|
||||||
[WEBSOCKET_KEEP_ALIVE_TIMEOUT]=${WEBSOCKET_KEEP_ALIVE_TIMEOUT}
|
|
||||||
[WEBSOCKET_RATE_LIMIT_BURST]=${WEBSOCKET_RATE_LIMIT_BURST}
|
|
||||||
[WEBSOCKET_RATE_LIMIT_DELAY]=${WEBSOCKET_RATE_LIMIT_DELAY}
|
|
||||||
|
|
||||||
[ODOO_RC]=${ODOO_RC}
|
# Removing any quotes around the value
|
||||||
[SAVE]=${SAVE}
|
value=${value%\"}
|
||||||
[INIT]=${INIT}
|
value=${value#\"}
|
||||||
[UPDATE]=${UPDATE}
|
|
||||||
[DEMO]=${DEMO}
|
|
||||||
[WITHOUT_DEMO]=${WITHOUT_DEMO}
|
|
||||||
[IMPORT_PARTIAL]=${IMPORT_PARTIAL}
|
|
||||||
[PIDFILE]=${PIDFILE}
|
|
||||||
[ADDONS_PATH]=${ADDONS_PATH}
|
|
||||||
[UPGRADE_PATH]=${UPGRADE_PATH}
|
|
||||||
[SERVER_WIDE_MODULES]=${SERVER_WIDE_MODULES}
|
|
||||||
[DATA_DIR]=${DATA_DIR}
|
|
||||||
|
|
||||||
[HTTP_INTERFACE]=${HTTP_INTERFACE}
|
# Evaluate any variables within value
|
||||||
[HTTP_PORT]=${HTTP_PORT}
|
eval "value=\"$value\""
|
||||||
[XMLRPCS_INTERFACE]=${XMLRPCS_INTERFACE}
|
|
||||||
[XMLRPCS_PORT]=${XMLRPCS_PORT}
|
|
||||||
[GEVENT_PORT]=${GEVENT_PORT}
|
|
||||||
[HTTP_ENABLE]=${HTTP_ENABLE}
|
|
||||||
[XMLRPCS]=${XMLRPCS}
|
|
||||||
[PROXY_MODE]=${PROXY_MODE}
|
|
||||||
[X_SENDFILE]=${X_SENDFILE}
|
|
||||||
|
|
||||||
[DBFILTER]=${DBFILTER}
|
export "$key=$value"
|
||||||
|
done < .env
|
||||||
|
|
||||||
[TEST_FILE]=${TEST_FILE}
|
# Check the USE_REDIS to add base_attachment_object_storage & session_redis to LOAD variable
|
||||||
[TEST_ENABLE]=${TEST_ENABLE}
|
if [[ $USE_REDIS == "true" ]]; then
|
||||||
[TEST_TAGS]=${TEST_TAGS}
|
LOAD+=",session_redis"
|
||||||
[SCREENCASTS]=${SCREENCASTS}
|
|
||||||
[SCREENSHOTS]=${SCREENSHOTS}
|
|
||||||
|
|
||||||
[LOGFILE]=${LOGFILE}
|
|
||||||
[SYSLOG]=${SYSLOG}
|
|
||||||
[LOG_HANDLER]=${LOG_HANDLER}
|
|
||||||
[LOG_DB]=${LOG_DB}
|
|
||||||
[LOG_DB_LEVEL]=${LOG_DB_LEVEL}
|
|
||||||
[LOG_LEVEL]=${LOG_LEVEL}
|
|
||||||
|
|
||||||
[EMAIL_FROM]=${EMAIL_FROM}
|
|
||||||
[FROM_FILTER]=${FROM_FILTER}
|
|
||||||
[SMTP_SERVER]=${SMTP_SERVER}
|
|
||||||
[SMTP_PORT]=${SMTP_PORT}
|
|
||||||
[SMTP_SSL]=${SMTP_SSL}
|
|
||||||
[SMTP_USER]=${SMTP_USER}
|
|
||||||
[SMTP_PASSWORD]=${SMTP_PASSWORD}
|
|
||||||
[SMTP_SSL_CERTIFICATE_FILENAME]=${SMTP_SSL_CERTIFICATE_FILENAME}
|
|
||||||
[SMTP_SSL_PRIVATE_KEY_FILENAME]=${SMTP_SSL_PRIVATE_KEY_FILENAME}
|
|
||||||
|
|
||||||
[DB_NAME]=${DB_NAME}
|
|
||||||
[DB_USER]=${DB_USER}
|
|
||||||
[DB_PASSWORD]=${DB_PASSWORD}
|
|
||||||
[PG_PATH]=${PG_PATH}
|
|
||||||
[DB_HOST]=${DB_HOST}
|
|
||||||
[DB_PORT]=${DB_PORT}
|
|
||||||
[DB_SSLMODE]=${DB_SSLMODE}
|
|
||||||
[DB_MAXCONN]=${DB_MAXCONN}
|
|
||||||
[DB_TEMPLATE]=${DB_TEMPLATE}
|
|
||||||
|
|
||||||
[LOAD_LANGUAGE]=${LOAD_LANGUAGE}
|
|
||||||
[LANGUAGE]=${LANGUAGE}
|
|
||||||
[TRANSLATE_OUT]=${TRANSLATE_OUT}
|
|
||||||
[TRANSLATE_IN]=${TRANSLATE_IN}
|
|
||||||
[OVERWRITE_EXISTING_TRANSLATIONS]=${OVERWRITE_EXISTING_TRANSLATIONS}
|
|
||||||
[TRANSLATE_MODULES]=${TRANSLATE_MODULES}
|
|
||||||
|
|
||||||
[LIST_DB]=${LIST_DB}
|
|
||||||
|
|
||||||
[DEV_MODE]=${DEV_MODE}
|
|
||||||
[SHELL_INTERFACE]=${SHELL_INTERFACE}
|
|
||||||
[STOP_AFTER_INIT]=${STOP_AFTER_INIT}
|
|
||||||
[OSV_MEMORY_COUNT_LIMIT]=${OSV_MEMORY_COUNT_LIMIT}
|
|
||||||
[TRANSIENT_AGE_LIMIT]=${TRANSIENT_AGE_LIMIT}
|
|
||||||
[MAX_CRON_THREADS]=${MAX_CRON_THREADS}
|
|
||||||
[UNACCENT]=${UNACCENT}
|
|
||||||
[GEOIP_DATABASE]=${GEOIP_DATABASE}
|
|
||||||
[WORKERS]=${WORKERS}
|
|
||||||
[LIMIT_MEMORY_SOFT]=${LIMIT_MEMORY_SOFT}
|
|
||||||
[LIMIT_MEMORY_HARD]=${LIMIT_MEMORY_HARD}
|
|
||||||
[LIMIT_TIME_CPU]=${LIMIT_TIME_CPU}
|
|
||||||
[LIMIT_TIME_REAL]=${LIMIT_TIME_REAL}
|
|
||||||
[LIMIT_TIME_REAL_CRON]=${LIMIT_TIME_REAL_CRON}
|
|
||||||
[LIMIT_REQUEST]=${LIMIT_REQUEST}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Define the template
|
|
||||||
template=$(cat << EOF
|
|
||||||
[options]
|
|
||||||
;------------------------------------------;
|
|
||||||
; Options not exposed on the command line. ;
|
|
||||||
;------------------------------------------;
|
|
||||||
|
|
||||||
admin_passwd = {ADMIN_PASSWD}
|
|
||||||
csv_internal_sep = {CSV_INTERNAL_SEP}
|
|
||||||
publisher_warranty_url = {PUBLISHER_WARRANTY_URL}
|
|
||||||
root_path = {ROOT_PATH}
|
|
||||||
reportgz = {REPORTGZ}
|
|
||||||
websocket_keep_alive_timeout = {WEBSOCKET_KEEP_ALIVE_TIMEOUT}
|
|
||||||
websocket_rate_limit_burst = {WEBSOCKET_RATE_LIMIT_BURST}
|
|
||||||
websocket_rate_limit_delay = {WEBSOCKET_RATE_LIMIT_DELAY}
|
|
||||||
|
|
||||||
;-----------------------;
|
|
||||||
; Server startup config ;
|
|
||||||
;-----------------------;
|
|
||||||
; --config | -c
|
|
||||||
config = {ODOO_RC}
|
|
||||||
|
|
||||||
; --save
|
|
||||||
save = {SAVE}
|
|
||||||
|
|
||||||
; --init | -i
|
|
||||||
init = {INIT}
|
|
||||||
|
|
||||||
; --update | -u
|
|
||||||
update = {UPDATE}
|
|
||||||
|
|
||||||
; --without-demo
|
|
||||||
demo = {DEMO}
|
|
||||||
without_demo = {WITHOUT_DEMO}
|
|
||||||
|
|
||||||
; --import-partial
|
|
||||||
import_partial = {IMPORT_PARTIAL}
|
|
||||||
|
|
||||||
; --pidfile
|
|
||||||
pidfile = {PIDFILE}
|
|
||||||
|
|
||||||
; --addons-path
|
|
||||||
addons_path = {ADDONS_PATH}
|
|
||||||
|
|
||||||
; --upgrade-path
|
|
||||||
upgrade_path = {UPGRADE_PATH}
|
|
||||||
|
|
||||||
; --load
|
|
||||||
server_wide_modules = {SERVER_WIDE_MODULES}
|
|
||||||
|
|
||||||
; --data-dir
|
|
||||||
data_dir = {DATA_DIR}
|
|
||||||
|
|
||||||
;------;
|
|
||||||
; HTTP ;
|
|
||||||
;------;
|
|
||||||
; --http-interface | --xmlrpc-interface
|
|
||||||
http_interface = {HTTP_INTERFACE}
|
|
||||||
|
|
||||||
; --http-port | -p | --xmlrpc-port
|
|
||||||
http_port = {HTTP_PORT}
|
|
||||||
|
|
||||||
; --xmlrpcs-interface
|
|
||||||
xmlrpcs_interface = {XMLRPCS_INTERFACE}
|
|
||||||
|
|
||||||
; --xmlrpcs-port
|
|
||||||
xmlrpcs_port = {XMLRPCS_PORT}
|
|
||||||
|
|
||||||
; --gevent-port | --longpolling_port (deprecated)
|
|
||||||
gevent_port = {GEVENT_PORT}
|
|
||||||
longpolling_port = False
|
|
||||||
|
|
||||||
; --no-http | --no-xmlrpc
|
|
||||||
http_enable = {HTTP_ENABLE}
|
|
||||||
|
|
||||||
; --no-xmlrpcs
|
|
||||||
xmlrpcs = {XMLRPCS}
|
|
||||||
|
|
||||||
; --proxy-mode
|
|
||||||
proxy_mode = {PROXY_MODE}
|
|
||||||
|
|
||||||
; --x-sendfile
|
|
||||||
x_sendfile = {X_SENDFILE}
|
|
||||||
|
|
||||||
;---------------;
|
|
||||||
; Testing Group ;
|
|
||||||
;---------------;
|
|
||||||
; --test-file
|
|
||||||
test_file = {TEST_FILE}
|
|
||||||
|
|
||||||
; --test-enable
|
|
||||||
test_enable = {TEST_ENABLE}
|
|
||||||
|
|
||||||
; --test-tags
|
|
||||||
test_tags = {TEST_FILE}
|
|
||||||
|
|
||||||
; --screencasts
|
|
||||||
screencasts = {SCREENCASTS}
|
|
||||||
|
|
||||||
; --screenshots
|
|
||||||
screenshots = {SCREENSHOTS}
|
|
||||||
|
|
||||||
;---------------;
|
|
||||||
; Logging Group ;
|
|
||||||
;---------------;
|
|
||||||
; --logfile
|
|
||||||
logfile = {LOGFILE}
|
|
||||||
|
|
||||||
; --syslog
|
|
||||||
syslog = {SYSLOG}
|
|
||||||
|
|
||||||
; --log-handler | --log-web (--log-handler=odoo.http:DEBUG) | --log-sql (--log-handler=odoo.sql_db:DEBUG)
|
|
||||||
log_handler = {LOG_HANDLER}
|
|
||||||
|
|
||||||
; --log-db
|
|
||||||
log_db = {LOG_DB}
|
|
||||||
|
|
||||||
; --log-db-level
|
|
||||||
log_db_level = {LOG_DB_LEVEL}
|
|
||||||
|
|
||||||
; --log-level
|
|
||||||
log_level = {LOG_LEVEL}
|
|
||||||
|
|
||||||
;------------;
|
|
||||||
; SMTP Group ;
|
|
||||||
;------------;
|
|
||||||
; --email-from
|
|
||||||
email_from = {EMAIL_FROM}
|
|
||||||
|
|
||||||
; --from-filter
|
|
||||||
from_filter = {FROM_FILTER}
|
|
||||||
|
|
||||||
; --smtp
|
|
||||||
smtp_server = {SMTP_SERVER}
|
|
||||||
|
|
||||||
; --smtp-port
|
|
||||||
smtp_port = {SMTP_PORT}
|
|
||||||
|
|
||||||
; --smtp-ssl
|
|
||||||
smtp_ssl = {SMTP_SSL}
|
|
||||||
|
|
||||||
; --smtp-user
|
|
||||||
smtp_user = {SMTP_USER}
|
|
||||||
|
|
||||||
; --smtp-password
|
|
||||||
smtp_password = {SMTP_PASSWORD}
|
|
||||||
|
|
||||||
; --smtp-ssl-certificate-filename
|
|
||||||
smtp_ssl_certificate_filename = {SMTP_SSL_CERTIFICATE_FILENAME}
|
|
||||||
|
|
||||||
; --smtp-ssl-private-key-filename
|
|
||||||
smtp_ssl_private_key_filename = {SMTP_SSL_PRIVATE_KEY_FILENAME}
|
|
||||||
|
|
||||||
;----------;
|
|
||||||
; DB Group ;
|
|
||||||
;----------;
|
|
||||||
; --database | -d
|
|
||||||
db_name = {DB_NAME}
|
|
||||||
|
|
||||||
; --db_user | -r
|
|
||||||
db_user = {DB_USER}
|
|
||||||
|
|
||||||
; --db_password | -w
|
|
||||||
db_password = {DB_PASSWORD}
|
|
||||||
|
|
||||||
; --pg_path
|
|
||||||
pg_path = {PG_PATH}
|
|
||||||
|
|
||||||
; --db_host
|
|
||||||
db_host = {DB_HOST}
|
|
||||||
|
|
||||||
; --db_port
|
|
||||||
db_port = {DB_PORT}
|
|
||||||
|
|
||||||
; --db_sslmode
|
|
||||||
db_sslmode = {DB_SSLMODE}
|
|
||||||
|
|
||||||
; --db_maxconn
|
|
||||||
db_maxconn = {DB_MAXCONN}
|
|
||||||
|
|
||||||
; --db-template
|
|
||||||
db_template = {DB_TEMPLATE}
|
|
||||||
|
|
||||||
;------------------------------;
|
|
||||||
; Internationalisation options ;
|
|
||||||
;------------------------------;
|
|
||||||
; --load-language
|
|
||||||
load_language = {LOAD_LANGUAGE}
|
|
||||||
|
|
||||||
; --language
|
|
||||||
language = {LANGUAGE}
|
|
||||||
|
|
||||||
; --i18n-export
|
|
||||||
translate_out = {TRANSLATE_OUT}
|
|
||||||
|
|
||||||
; --i18n-import
|
|
||||||
translate_in = {TRANSLATE_IN}
|
|
||||||
|
|
||||||
; --i18n-overwrite
|
|
||||||
overwrite_existing_translations = {OVERWRITE_EXISTING_TRANSLATIONS}
|
|
||||||
|
|
||||||
; --modules
|
|
||||||
translate_modules = {TRANSLATE_MODULES}
|
|
||||||
|
|
||||||
;----------;
|
|
||||||
; Security ;
|
|
||||||
;----------;
|
|
||||||
; --no-database-list
|
|
||||||
list_db = {LIST_DB}
|
|
||||||
|
|
||||||
;-----;
|
|
||||||
; WEB ;
|
|
||||||
;-----;
|
|
||||||
; --db-filter
|
|
||||||
dbfilter = {DBFILTER}
|
|
||||||
|
|
||||||
;------------------;
|
|
||||||
; Advanced options ;
|
|
||||||
;------------------;
|
|
||||||
; --dev
|
|
||||||
dev_mode = {DEV_MODE}
|
|
||||||
|
|
||||||
; --shell-interface
|
|
||||||
shell_interface = {SHELL_INTERFACE}
|
|
||||||
|
|
||||||
; --stop-after-init
|
|
||||||
stop_after_init = {STOP_AFTER_INIT}
|
|
||||||
|
|
||||||
; --osv-memory-count-limit
|
|
||||||
osv_memory_count_limit = {OSV_MEMORY_COUNT_LIMIT}
|
|
||||||
|
|
||||||
; --transient-age-limit | --osv-memory-age-limit (deprecated)
|
|
||||||
transient_age_limit = {TRANSIENT_AGE_LIMIT}
|
|
||||||
|
|
||||||
; --max-cron-threads
|
|
||||||
max_cron_threads = {MAX_CRON_THREADS}
|
|
||||||
|
|
||||||
; --unaccent
|
|
||||||
unaccent = {UNACCENT}
|
|
||||||
|
|
||||||
; --geoip-db
|
|
||||||
geoip_database = {GEOIP_DATABASE}
|
|
||||||
|
|
||||||
; --workers
|
|
||||||
workers = {WORKERS}
|
|
||||||
|
|
||||||
; --limit-memory-soft
|
|
||||||
limit_memory_soft = {LIMIT_MEMORY_SOFT}
|
|
||||||
|
|
||||||
; --limit-memory-hard
|
|
||||||
limit_memory_hard = {LIMIT_MEMORY_HARD}
|
|
||||||
|
|
||||||
; --limit-time-cpu
|
|
||||||
limit_time_cpu = {LIMIT_TIME_CPU}
|
|
||||||
|
|
||||||
; --limit-time-real
|
|
||||||
limit_time_real = {LIMIT_TIME_REAL}
|
|
||||||
|
|
||||||
; --limit-time-real-cron
|
|
||||||
limit_time_real_cron = {LIMIT_TIME_REAL_CRON}
|
|
||||||
|
|
||||||
; --limit-request
|
|
||||||
limit_request = {LIMIT_REQUEST}
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
# Override defaults with values from environment variables
|
|
||||||
for key in "${!defaults[@]}"; do
|
|
||||||
if [[ ! ${defaults[$key]} =~ ^\{.*\}$ ]]; then
|
|
||||||
value=${!key:-${defaults[$key]}}
|
|
||||||
template="${template//\{$key\}/$value}"
|
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
# Store the result to the odoo.conf file
|
# Check the USE_REDIS to add attachment_s3 to LOAD variable
|
||||||
echo "$template" > ${ODOO_RC}
|
if [[ $USE_S3 == "true" ]]; then
|
||||||
|
LOAD+=",base_attachment_object_storage"
|
||||||
|
LOAD+=",attachment_s3"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check the USE_REDIS to add sentry to LOAD variable
|
||||||
|
if [[ $USE_SENTRY == "true" ]]; then
|
||||||
|
LOAD+=",sentry"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy the example conf to the destination to start replacing the variables
|
||||||
|
cp "$TEMPLATE_CONF" "$ODOO_RC"
|
||||||
|
|
||||||
|
# Second pass: Replace the variables in $ODOO_RC
|
||||||
|
while IFS='=' read -r key value || [[ -n $key ]]; do
|
||||||
|
# Skip comments and empty lines
|
||||||
|
[[ $key =~ ^#.* ]] || [[ -z $key ]] && continue
|
||||||
|
|
||||||
|
value=${!key} # Get the value of the variable whose name is $key
|
||||||
|
|
||||||
|
# Escape characters which are special to sed
|
||||||
|
value_escaped=$(echo "$value" | sed 's/[\/&]/\\&/g')
|
||||||
|
|
||||||
|
# Replace occurrences of the key with the value in $ODOO_RC
|
||||||
|
sed -i "s/\${$key}/${value_escaped}/g" "$ODOO_RC"
|
||||||
|
done < .env
|
||||||
|
|
||||||
|
echo "Configuration file is generated at $ODOO_RC"
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
debugpy
|
debugpy
|
||||||
websocket-client
|
websocket-client
|
||||||
|
redis
|
||||||
|
boto3
|
||||||
|
sentry-sdk==1.9.0 # Fixed because Odoo depends on urllib3==1.26.5
|
||||||
|
|||||||
18
odoo/third-party-addons.txt
Normal file
18
odoo/third-party-addons.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# This file is read by clone-addons.sh
|
||||||
|
|
||||||
|
# Enterprise addons
|
||||||
|
enterprise https://github.com/odoo/enterprise true
|
||||||
|
|
||||||
|
# Odoocker repositories
|
||||||
|
public https://github.com/odoocker/odoocker-modules.git odoocker_base true
|
||||||
|
public https://github.com/odoocker/odoo-cloud-platform.git session_redis ${USE_REDIS} base_attachment_object_storage ${USE_S3} attachment_s3 ${USE_S3}
|
||||||
|
public https://github.com/odoocker/server-tools.git sentry ${USE_SENTRY}
|
||||||
|
|
||||||
|
# Add repositories with the following format:
|
||||||
|
# <public|private> <repo_url> <true|false>
|
||||||
|
# or
|
||||||
|
# <public|private> <repo_url> <module1> <true|false> <module2> <true|false> ...
|
||||||
|
|
||||||
|
# Public repositories
|
||||||
|
|
||||||
|
# Private repositories
|
||||||
35
pgadmin/Dockerfile
Normal file
35
pgadmin/Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#------------------------#
|
||||||
|
# PGAdmin Server #
|
||||||
|
#------------------------#
|
||||||
|
ARG PGADMIN_TAG
|
||||||
|
FROM dpage/pgadmin4:${PGADMIN_TAG}
|
||||||
|
|
||||||
|
# Receive ARGs from docker-compose.yml & convert them into ENVs
|
||||||
|
ARG PGADMIN_DEFAULT_EMAIL
|
||||||
|
|
||||||
|
ENV PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
|
||||||
|
|
||||||
|
# Switch to root user
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Install bash
|
||||||
|
RUN apk add --no-cache bash jq sqlite
|
||||||
|
|
||||||
|
# Check if the private key exists, copy it and set permissions if it does
|
||||||
|
RUN if [ -f ./pgadmin/private_key ]; then \
|
||||||
|
cp ./pgadmin/private_key /pgadmin4/private_key && \
|
||||||
|
chown pgadmin:root /pgadmin4/private_key && \
|
||||||
|
chmod 600 /pgadmin4/private_key; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy your script file into the Docker image
|
||||||
|
COPY --chown=pgadmin:root ./.env /
|
||||||
|
COPY ./pgadmin/start_pgadmin.sh /var/lib/pgadmin/start_pgadmin.sh
|
||||||
|
|
||||||
|
# Make the script executable
|
||||||
|
RUN chmod +x /var/lib/pgadmin/start_pgadmin.sh
|
||||||
|
# Run your script
|
||||||
|
RUN /var/lib/pgadmin/start_pgadmin.sh
|
||||||
|
|
||||||
|
# Expose the necessary port
|
||||||
|
EXPOSE 80
|
||||||
86
pgadmin/start_pgadmin.sh
Executable file
86
pgadmin/start_pgadmin.sh
Executable file
@@ -0,0 +1,86 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Source environment variables
|
||||||
|
set -a
|
||||||
|
source /.env
|
||||||
|
set +a
|
||||||
|
|
||||||
|
# Check if PGADMIN_DEFAULT_EMAIL is set
|
||||||
|
if [[ -z $PGADMIN_DEFAULT_EMAIL ]]; then
|
||||||
|
echo "PGADMIN_DEFAULT_EMAIL is not set. Exiting..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Modify the email to replace @ with _
|
||||||
|
DIR_NAME="/var/lib/pgadmin/storage/${PGADMIN_DEFAULT_EMAIL//@/_}"
|
||||||
|
|
||||||
|
# Create the directory using the modified name
|
||||||
|
mkdir -p "$DIR_NAME"
|
||||||
|
|
||||||
|
# Generate JSON for each matching variable
|
||||||
|
DB_PATH="/var/lib/pgadmin/pgadmin4.db"
|
||||||
|
json_output="{\"Servers\":{"
|
||||||
|
index=1
|
||||||
|
while true; do
|
||||||
|
name_var="PGADMIN_DB${index}_NAME"
|
||||||
|
if [[ -z ${!name_var} ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
host_var="PGADMIN_DB${index}_HOST"
|
||||||
|
port_var="PGADMIN_DB${index}_PORT"
|
||||||
|
maintenance_db_var="PGADMIN_DB${index}_MAINTENANCE_DB"
|
||||||
|
username_var="PGADMIN_DB${index}_USERNAME"
|
||||||
|
tunnel_host_var="PGADMIN_DB${index}_TUNNEL_HOST"
|
||||||
|
tunnel_port_var="PGADMIN_DB${index}_TUNNEL_PORT"
|
||||||
|
tunnel_username_var="PGADMIN_DB${index}_TUNNEL_USERNAME"
|
||||||
|
|
||||||
|
json_output+="\"$index\":$(jq -n \
|
||||||
|
--arg name "${!name_var}" \
|
||||||
|
--arg host "${!host_var:-localhost}" \
|
||||||
|
--arg port "${!port_var:-5432}" \
|
||||||
|
--arg db "${!maintenance_db_var:-${!name_var}}" \
|
||||||
|
--arg username "${!username_var:-odoo}" \
|
||||||
|
--arg thost "${!tunnel_host_var}" \
|
||||||
|
--arg tport "${!tunnel_port_var:-22}" \
|
||||||
|
--arg tuser "${!tunnel_username_var:-ubuntu}" \
|
||||||
|
'{
|
||||||
|
"Name": $name,
|
||||||
|
"Group": "Servers",
|
||||||
|
"Host": $host,
|
||||||
|
"Port": $port|tonumber,
|
||||||
|
"MaintenanceDB": $db,
|
||||||
|
"Username": $username,
|
||||||
|
"UseSSHTunnel": 1,
|
||||||
|
"TunnelHost": $thost,
|
||||||
|
"TunnelPort": $tport,
|
||||||
|
"TunnelUsername": $tuser,
|
||||||
|
"TunnelAuthentication": 1,
|
||||||
|
"KerberosAuthentication": false,
|
||||||
|
"ConnectionParameters": {
|
||||||
|
"sslmode": "prefer",
|
||||||
|
"connect_timeout": 10,
|
||||||
|
"sslcert": "'"$DIR_NAME"'/.postgresql/postgresql.crt",
|
||||||
|
"sslkey": "'"$DIR_NAME"'/.postgresql/postgresql.key"
|
||||||
|
},
|
||||||
|
"Shared": true
|
||||||
|
}'),"
|
||||||
|
|
||||||
|
index=$((index + 1))
|
||||||
|
done
|
||||||
|
|
||||||
|
# Remove trailing comma and close JSON braces
|
||||||
|
json_output=${json_output%,}
|
||||||
|
json_output+="}}"
|
||||||
|
|
||||||
|
# Save the well-formatted JSON to a file using jq
|
||||||
|
if [[ $PGADMIN_SERVERS_JSON ]]; then
|
||||||
|
echo $json_output | jq '.' > "$PGADMIN_SERVERS_JSON"
|
||||||
|
|
||||||
|
# Make the Servers.json file readable for all users
|
||||||
|
chmod 755 "/pgadmin4/servers.json"
|
||||||
|
|
||||||
|
echo "JSON configuration saved to $DIR_NAME/servers.json"
|
||||||
|
fi
|
||||||
@@ -8,8 +8,11 @@ FROM postgres:${POSTGRES_TAG}
|
|||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
# Unaccent extension dependencies
|
# Unaccent extension dependencies
|
||||||
postgresql-contrib \
|
postgresql-contrib \
|
||||||
|
apt-utils \
|
||||||
# Clean up the apt cache to reduce the image size
|
# Clean up the apt cache to reduce the image size
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --chown=postgres:postgres ./.env /
|
||||||
|
|
||||||
# Copy the script to create the unaccent template
|
# Copy the script to create the unaccent template
|
||||||
COPY ./entrypoint.sh /docker-entrypoint-initdb.d/entrypoint.sh
|
COPY ./postgres/entrypoint.sh /docker-entrypoint-initdb.d/entrypoint.sh
|
||||||
|
|||||||
@@ -1,3 +1,35 @@
|
|||||||
psql -p 5432 -U odoo -d postgres -c "CREATE DATABASE unaccent_template WITH TEMPLATE = template0"
|
#!/bin/bash
|
||||||
psql -p 5432 -U odoo -d postgres -c "\\c unaccent_template"
|
|
||||||
psql -p 5432 -U odoo -d postgres -c "CREATE EXTENSION IF NOT EXISTS unaccent;"
|
set -e
|
||||||
|
|
||||||
|
# Source environment variables
|
||||||
|
set -a
|
||||||
|
source /.env
|
||||||
|
set +a
|
||||||
|
|
||||||
|
# Create the $DB_TEMPLATE database
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE DATABASE $DB_TEMPLATE WITH TEMPLATE = template0;"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "\\c $DB_TEMPLATE;"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $DB_TEMPLATE -c "CREATE EXTENSION IF NOT EXISTS unaccent;"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $DB_TEMPLATE -c "ALTER FUNCTION unaccent(text) IMMUTABLE;"
|
||||||
|
|
||||||
|
# Create Odoo user and give proper privileges
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE USER $DB_USER WITH PASSWORD '$DB_PASSWORD';"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "ALTER USER $DB_USER CREATEDB;"
|
||||||
|
|
||||||
|
# Give Odoo user access to copy $DB_TEMPLATE
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "GRANT ALL PRIVILEGES ON DATABASE $DB_TEMPLATE TO $DB_USER;"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $DB_TEMPLATE -c "ALTER DATABASE $DB_TEMPLATE OWNER TO $DB_USER;"
|
||||||
|
|
||||||
|
# Check the USE_REDIS to add sentry to LOAD variable
|
||||||
|
if [[ $USE_PGADMIN == "true" ]]; then
|
||||||
|
# Create PgAdmin user and give proper privileges
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE DATABASE $PGADMING_DB_NAME;"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "CREATE USER $PGADMING_DB_USER WITH PASSWORD '$PGADMIN_DB_PASSWORD';"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "GRANT ALL PRIVILEGES ON DATABASE $PGADMING_DB_NAME TO $PGADMING_DB_USER;"
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $PGADMING_DB_NAME -c "GRANT ALL PRIVILEGES ON SCHEMA public TO $PGADMING_DB_USER;"
|
||||||
|
# Revoke Odoo user's access to pgadmin database
|
||||||
|
psql -p $POSTGRES_PORT -U $POSTGRES_MAIN_USER -d $POSTGRES_DB -c "REVOKE CONNECT ON DATABASE $PGADMING_DB_NAME FROM $DB_USER;"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Setup completed."
|
||||||
|
|||||||
Reference in New Issue
Block a user