From ca55f3d0d0dcdc828a2183685dfad1be471ac414 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 19 Oct 2023 19:14:12 -0500 Subject: [PATCH 01/11] starting new ideas for docker-compose file --- docker-compose copy.yml | 152 ++++++++++++++++++ docker-compose.override.local.full.yml | 49 ++++++ ...l => docker-compose.override.local.min.yml | 0 docker-compose.yml | 71 ++++---- odoo/third-party-addons.sh | 16 +- 5 files changed, 252 insertions(+), 36 deletions(-) create mode 100644 docker-compose copy.yml create mode 100644 docker-compose.override.local.full.yml rename docker-compose.override.local.yml => docker-compose.override.local.min.yml (100%) diff --git a/docker-compose copy.yml b/docker-compose copy.yml new file mode 100644 index 0000000..d9aea0d --- /dev/null +++ b/docker-compose copy.yml @@ -0,0 +1,152 @@ +services: + odoo: + build: + context: ./ + dockerfile: ./odoo/Dockerfile + args: + - ODOO_TAG + - ODOO_RC + - ROOT_PATH + - GITHUB_USER + - GITHUB_ACCESS_TOKEN + - ENTERPRISE_ADDONS + - THIRD_PARTY_ADDONS + - LOG_PATH + depends_on: + - postgres + tty: true + volumes: + - odoo-data:${DATA_DIR} + - ./odoo/extra-addons:${EXTRA_ADDONS} + - ./odoo/custom-addons:${CUSTOM_ADDONS} + - ./odoo/entrypoint.sh:/entrypoint.sh + environment: + - HOST=${DB_HOST} + - PORT=${DB_PORT} + - USER=${DB_USER} + - PASSWORD=${DB_PASSWORD} + - ODOO_TAG + - ODOO_RC + - 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: + - internal + + postgres: + build: + context: ./ + dockerfile: ./postgres/Dockerfile + args: + - POSTGRES_TAG + restart: unless-stopped + tty: true + volumes: + - pg-data:${PGDATA} + - ./postgres/entrypoint.sh:/docker-entrypoint-initdb.d/entrypoint.sh + environment: + - POSTGRES_DB + - POSTGRES_USER + - POSTGRES_PASSWORD + - PGDATA + - DB_USER + - DB_TEMPLATE + - UNACCENT_TEMPLATE + - PGADMING_DB_NAME + - PGADMING_DB_USER + - PGADMIN_DB_PASSWORD + networks: + - internal + + redis: + image: eqalpha/keydb:${KEYDB_TAG} + platform: linux/amd64 + ports: + - ${KEYDB_PORT}:${KEYDB_PORT} + restart: unless-stopped + volumes: + - redis-data:${KEYDB_DATA} + networks: + - internal + + 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 + + nginx: + image: nginx:${NGINX_TAG} + depends_on: + - odoo + restart: unless-stopped + tty: true + expose: + - 80/tcp + volumes: + - ./nginx/nginx.conf:${NGINX_CONF} + - ./nginx/default.conf:${NGINX_DEFAULT_CONF} + environment: + - VIRTUAL_HOST + - LETSENCRYPT_HOST + - LETSENCRYPT_EMAIL + - CORS_ALLOWED_DOMAIN + networks: + - internal + + nginx-proxy: + image: nginxproxy/nginx-proxy:${NGINX_PROXY_TAG} + depends_on: + - nginx + restart: unless-stopped + tty: true + volumes: + - ./nginx-proxy/nginx.conf:${NGINX_CONF} + - ./nginx-proxy/cors.conf:${NGINX_PROXY_CORS_CONF} + - certs:${NGINX_CERTS}:ro + - vhost:${NGINX_VHOST} + - html:${NGINX_HTML} + - ${DOCKER_SOCK}:${TEMP_DOCKER_SOCK}:ro + environment: + - TRUST_DOWNSTREAM_PROXY + - CORS_ALLOWED_DOMAIN + networks: + - internal + +volumes: + odoo-data: + pg-data: + redis-data: + s3-data: + certs: + vhost: + html: + +networks: + internal: + driver: bridge diff --git a/docker-compose.override.local.full.yml b/docker-compose.override.local.full.yml new file mode 100644 index 0000000..ce310ca --- /dev/null +++ b/docker-compose.override.local.full.yml @@ -0,0 +1,49 @@ +services: + odoo: + restart: 'no' + ports: + - 8069:8069 + - 8070:8070 + - 8071:8071 + - 8072:8072 + + postgres: + restart: 'no' + ports: + - 5432:5432 + + nginx: + restart: 'no' + + nginx-proxy: + restart: 'no' + ports: + - 80:80 + + redis: + image: eqalpha/keydb:${KEYDB_TAG} + platform: linux/amd64 + ports: + - ${KEYDB_PORT}:${KEYDB_PORT} + restart: unless-stopped + volumes: + - redis-data:${KEYDB_DATA} + networks: + - internal + + 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 \ No newline at end of file diff --git a/docker-compose.override.local.yml b/docker-compose.override.local.min.yml similarity index 100% rename from docker-compose.override.local.yml rename to docker-compose.override.local.min.yml diff --git a/docker-compose.yml b/docker-compose.yml index d9aea0d..5684d2e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ + + services: odoo: build: @@ -27,6 +29,9 @@ services: - PASSWORD=${DB_PASSWORD} - ODOO_TAG - ODOO_RC + - USE_REDIS + - USE_S3 + - USE_SENTRY - THIRD_PARTY_ADDONS - ODOO_SESSION_REDIS - ODOO_SESSION_REDIS_HOST @@ -72,34 +77,6 @@ services: networks: - internal - redis: - image: eqalpha/keydb:${KEYDB_TAG} - platform: linux/amd64 - ports: - - ${KEYDB_PORT}:${KEYDB_PORT} - restart: unless-stopped - volumes: - - redis-data:${KEYDB_DATA} - networks: - - internal - - 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 - nginx: image: nginx:${NGINX_TAG} depends_on: @@ -128,9 +105,9 @@ services: volumes: - ./nginx-proxy/nginx.conf:${NGINX_CONF} - ./nginx-proxy/cors.conf:${NGINX_PROXY_CORS_CONF} - - certs:${NGINX_CERTS}:ro - - vhost:${NGINX_VHOST} - html:${NGINX_HTML} + - vhost:${NGINX_VHOST} + - certs:${NGINX_CERTS}:ro - ${DOCKER_SOCK}:${TEMP_DOCKER_SOCK}:ro environment: - TRUST_DOWNSTREAM_PROXY @@ -138,14 +115,44 @@ services: networks: - internal + redis: + image: eqalpha/keydb:${KEYDB_TAG} + platform: linux/amd64 + ports: + - ${KEYDB_PORT}:${KEYDB_PORT} + restart: unless-stopped + volumes: + - redis-data:${KEYDB_DATA} + networks: + - internal + profiles: ["dev"] + + 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: ["dev"] + volumes: odoo-data: pg-data: redis-data: s3-data: - certs: - vhost: html: + vhost: + certs: networks: internal: diff --git a/odoo/third-party-addons.sh b/odoo/third-party-addons.sh index b32e745..3873793 100755 --- a/odoo/third-party-addons.sh +++ b/odoo/third-party-addons.sh @@ -2,16 +2,24 @@ set -e -# Check if the repository directory exists -if [ ! -d "odoo-cloud-platform" ]; then +# Check if the repository directory exists and either Redis or S3 is to be used +if [[ ! -d "odoo-cloud-platform" && ( $USE_REDIS -eq 1 || $USE_S3 -eq 1 ) ]]; then git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; +fi + +# Check the USE_REDIS variable to decide whether to copy Redis directories +if [[ $USE_REDIS -eq 1 ]]; then cp -r odoo-cloud-platform/session_redis ${THIRD_PARTY_ADDONS}/session_redis +fi + +# Check the USE_S3 variable to decide whether to copy S3 directories +if [[ $USE_S3 -eq 1 ]]; then cp -r odoo-cloud-platform/base_attachment_object_storage ${THIRD_PARTY_ADDONS}/base_attachment_object_storage cp -r odoo-cloud-platform/attachment_s3 ${THIRD_PARTY_ADDONS}/attachment_s3 fi -# Check if the repository directory exists -if [ ! -d "server-tools" ]; then +# Check if the repository directory exists and Sentry is to be used +if [[ ! -d "server-tools" && $USE_SENTRY -eq 1 ]]; then git clone https://github.com/odoocker/server-tools.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; cp -r server-tools/sentry ${THIRD_PARTY_ADDONS}/sentry fi From 688a5902829b2ca8347e9767e8f2ffe6c3ed9bf4 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 19 Oct 2023 21:30:09 -0500 Subject: [PATCH 02/11] cleanup --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 388438d..7db34b2 100644 --- a/.env.example +++ b/.env.example @@ -36,14 +36,14 @@ LOG_LEVEL=info # Additional logs LOG_HANDLER_LEVEL=INFO # Sentry -SENTRY_DSN=https://84799fb74edc4053aa3368aec3c2cb89@o4504596558577664.ingest.sentry.io/4504596563230720 +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_RELEASE=1.0 SENTRY_ODOO_DIR=${ROOT_PATH} # Nginx From 70fc974b62f462b6da1baa286439b02ae3189a0a Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 19 Oct 2023 22:11:19 -0500 Subject: [PATCH 03/11] added profiles for containers management --- .env.example | 30 +++- docker-compose copy.yml | 152 ------------------ docker-compose.override.local.full.yml | 49 ------ ...n.yml => docker-compose.override.local.yml | 0 docker-compose.override.production.yml | 16 -- docker-compose.pgadmin.yml | 45 ------ docker-compose.yml | 70 +++++++- 7 files changed, 92 insertions(+), 270 deletions(-) delete mode 100644 docker-compose copy.yml delete mode 100644 docker-compose.override.local.full.yml rename docker-compose.override.local.min.yml => docker-compose.override.local.yml (100%) delete mode 100644 docker-compose.pgadmin.yml diff --git a/.env.example b/.env.example index 7db34b2..765a001 100644 --- a/.env.example +++ b/.env.example @@ -5,21 +5,21 @@ APP_ENV=local INIT= UPDATE= -LOAD=base,web,session_redis,attachment_s3,sentry +LOAD=base,web ROOT_PATH=/usr/lib/python3/dist-packages/odoo WORKERS=2 DEV_MODE=reload,xml DOMAIN=erp.odoocker.test # Enterprise -GITHUB_USER= -GITHUB_ACCESS_TOKEN= +GITHUB_USER=yhaelopez +GITHUB_ACCESS_TOKEN=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 # Database ADMIN_PASSWD=odoo DB_HOST=postgres DB_PORT=5432 -DB_NAME=odoocker +DB_NAME= DB_USER=odoo DB_PASSWORD=odoo LOAD_LANGUAGE= @@ -43,7 +43,7 @@ SENTRY_EXCLUDE_LOGGERS= SENTRY_IGNORE_EXCEPTIONS= SENTRY_INCLUDE_CONTEXT=true SENTRY_ENVIRONMENT=production -SENTRY_RELEASE=1.0 +SENTRY_RELEASE= SENTRY_ODOO_DIR=${ROOT_PATH} # Nginx @@ -114,6 +114,24 @@ PGADMIN_CONFIG_SERVER_MODE=True PROJECT_NAME=odoocker SUPPORT_EMAIL=mail@example.com +# Service configuration +USE_REDIS=false +USE_S3=false +USE_SENTRY=false + +# Which services are going to be brought up +COMPOSE_PROFILES=base + +# Service profiles +ODOO_PROFILES="base" +POSTGRES_PROFILES="base" +NGINX_PROFILES="base" +NGINX_PROXY_PROFILES="base" +ACME_COMPANION_PROFILES="ssl" +KEYDB_PROFILES="cache" +MINIO_PROFILES="storage" +PGADMIN_PROFILES="admin" + # Containers' Tags ODOO_TAG=16.0 POSTGRES_TAG=16.0 @@ -124,7 +142,7 @@ NGINX_PROXY_TAG=1.3.1 ACME_COMPANION_TAG=2.2.8 PGADMIN_TAG=7.6 -# Custom paths +# Odoocker paths COMMUNITY_ADDONS=${ROOT_PATH}/addons ENTERPRISE_ADDONS=${ROOT_PATH}/enterprise THIRD_PARTY_ADDONS=${ROOT_PATH}/third-party-addons diff --git a/docker-compose copy.yml b/docker-compose copy.yml deleted file mode 100644 index d9aea0d..0000000 --- a/docker-compose copy.yml +++ /dev/null @@ -1,152 +0,0 @@ -services: - odoo: - build: - context: ./ - dockerfile: ./odoo/Dockerfile - args: - - ODOO_TAG - - ODOO_RC - - ROOT_PATH - - GITHUB_USER - - GITHUB_ACCESS_TOKEN - - ENTERPRISE_ADDONS - - THIRD_PARTY_ADDONS - - LOG_PATH - depends_on: - - postgres - tty: true - volumes: - - odoo-data:${DATA_DIR} - - ./odoo/extra-addons:${EXTRA_ADDONS} - - ./odoo/custom-addons:${CUSTOM_ADDONS} - - ./odoo/entrypoint.sh:/entrypoint.sh - environment: - - HOST=${DB_HOST} - - PORT=${DB_PORT} - - USER=${DB_USER} - - PASSWORD=${DB_PASSWORD} - - ODOO_TAG - - ODOO_RC - - 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: - - internal - - postgres: - build: - context: ./ - dockerfile: ./postgres/Dockerfile - args: - - POSTGRES_TAG - restart: unless-stopped - tty: true - volumes: - - pg-data:${PGDATA} - - ./postgres/entrypoint.sh:/docker-entrypoint-initdb.d/entrypoint.sh - environment: - - POSTGRES_DB - - POSTGRES_USER - - POSTGRES_PASSWORD - - PGDATA - - DB_USER - - DB_TEMPLATE - - UNACCENT_TEMPLATE - - PGADMING_DB_NAME - - PGADMING_DB_USER - - PGADMIN_DB_PASSWORD - networks: - - internal - - redis: - image: eqalpha/keydb:${KEYDB_TAG} - platform: linux/amd64 - ports: - - ${KEYDB_PORT}:${KEYDB_PORT} - restart: unless-stopped - volumes: - - redis-data:${KEYDB_DATA} - networks: - - internal - - 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 - - nginx: - image: nginx:${NGINX_TAG} - depends_on: - - odoo - restart: unless-stopped - tty: true - expose: - - 80/tcp - volumes: - - ./nginx/nginx.conf:${NGINX_CONF} - - ./nginx/default.conf:${NGINX_DEFAULT_CONF} - environment: - - VIRTUAL_HOST - - LETSENCRYPT_HOST - - LETSENCRYPT_EMAIL - - CORS_ALLOWED_DOMAIN - networks: - - internal - - nginx-proxy: - image: nginxproxy/nginx-proxy:${NGINX_PROXY_TAG} - depends_on: - - nginx - restart: unless-stopped - tty: true - volumes: - - ./nginx-proxy/nginx.conf:${NGINX_CONF} - - ./nginx-proxy/cors.conf:${NGINX_PROXY_CORS_CONF} - - certs:${NGINX_CERTS}:ro - - vhost:${NGINX_VHOST} - - html:${NGINX_HTML} - - ${DOCKER_SOCK}:${TEMP_DOCKER_SOCK}:ro - environment: - - TRUST_DOWNSTREAM_PROXY - - CORS_ALLOWED_DOMAIN - networks: - - internal - -volumes: - odoo-data: - pg-data: - redis-data: - s3-data: - certs: - vhost: - html: - -networks: - internal: - driver: bridge diff --git a/docker-compose.override.local.full.yml b/docker-compose.override.local.full.yml deleted file mode 100644 index ce310ca..0000000 --- a/docker-compose.override.local.full.yml +++ /dev/null @@ -1,49 +0,0 @@ -services: - odoo: - restart: 'no' - ports: - - 8069:8069 - - 8070:8070 - - 8071:8071 - - 8072:8072 - - postgres: - restart: 'no' - ports: - - 5432:5432 - - nginx: - restart: 'no' - - nginx-proxy: - restart: 'no' - ports: - - 80:80 - - redis: - image: eqalpha/keydb:${KEYDB_TAG} - platform: linux/amd64 - ports: - - ${KEYDB_PORT}:${KEYDB_PORT} - restart: unless-stopped - volumes: - - redis-data:${KEYDB_DATA} - networks: - - internal - - 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 \ No newline at end of file diff --git a/docker-compose.override.local.min.yml b/docker-compose.override.local.yml similarity index 100% rename from docker-compose.override.local.min.yml rename to docker-compose.override.local.yml diff --git a/docker-compose.override.production.yml b/docker-compose.override.production.yml index d01c989..f7e4055 100644 --- a/docker-compose.override.production.yml +++ b/docker-compose.override.production.yml @@ -17,22 +17,6 @@ services: - 80:80 - 443:443 - letsencrypt: - image: nginxproxy/acme-companion:${ACME_COMPANION_TAG} - depends_on: - - nginx-proxy - 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: acme: certs: diff --git a/docker-compose.pgadmin.yml b/docker-compose.pgadmin.yml deleted file mode 100644 index 7fccf84..0000000 --- a/docker-compose.pgadmin.yml +++ /dev/null @@ -1,45 +0,0 @@ -services: - pgadmin: - build: - context: ./ - dockerfile: ./pgadmin/Dockerfile - args: - - PGADMIN_TAG - depends_on: - - postgres - restart: 'no' - 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 - -volumes: - pgadmin-data: diff --git a/docker-compose.yml b/docker-compose.yml index 5684d2e..35f717c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,7 @@ services: - AWS_BUCKETNAME networks: - internal + profiles: [$ODOO_PROFILES] postgres: build: @@ -76,6 +77,7 @@ services: - PGADMIN_DB_PASSWORD networks: - internal + profiles: [$POSTGRES_PROFILES] nginx: image: nginx:${NGINX_TAG} @@ -95,6 +97,7 @@ services: - CORS_ALLOWED_DOMAIN networks: - internal + profiles: [$NGINX_PROFILES] nginx-proxy: image: nginxproxy/nginx-proxy:${NGINX_PROXY_TAG} @@ -114,6 +117,7 @@ services: - CORS_ALLOWED_DOMAIN networks: - internal + profiles: [$NGINX_PROXY_PROFILES] redis: image: eqalpha/keydb:${KEYDB_TAG} @@ -125,7 +129,7 @@ services: - redis-data:${KEYDB_DATA} networks: - internal - profiles: ["dev"] + profiles: [$KEYDB_PROFILES] s3: image: minio/minio:${MINIO_TAG} @@ -143,16 +147,78 @@ services: - ${MINIO_CONSOLE_PORT}:${MINIO_CONSOLE_PORT} networks: - internal - profiles: ["dev"] + profiles: [$MINIO_PROFILES] + + letsencrypt: + image: nginxproxy/acme-companion:${ACME_COMPANION_TAG} + depends_on: + - nginx-proxy + 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 + profiles: [$ACME_COMPANION_PROFILES] + + pgadmin: + build: + context: ./ + dockerfile: ./pgadmin/Dockerfile + args: + - PGADMIN_TAG + depends_on: + - postgres + restart: 'no' + 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: odoo-data: pg-data: redis-data: s3-data: + pgadmin-data: html: vhost: certs: + acme: networks: internal: From 986fffafc36149f6c2418f6b87c5a6c857be507c Mon Sep 17 00:00:00 2001 From: Yhael S Date: Thu, 19 Oct 2023 22:12:18 -0500 Subject: [PATCH 04/11] cleanup --- .env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 765a001..0d81849 100644 --- a/.env.example +++ b/.env.example @@ -12,8 +12,8 @@ DEV_MODE=reload,xml DOMAIN=erp.odoocker.test # Enterprise -GITHUB_USER=yhaelopez -GITHUB_ACCESS_TOKEN=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 +GITHUB_USER= +GITHUB_ACCESS_TOKEN= # Database ADMIN_PASSWD=odoo From c3f70d3a99712cc00daa437ef925558ea3cec1e5 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 00:07:37 -0500 Subject: [PATCH 05/11] enable separated features --- .env.example | 5 ++++- docker-compose.override.local.yml | 1 + docker-compose.override.production.yml | 18 +----------------- docker-compose.yml | 7 +++++-- odoo/Dockerfile | 8 +++++++- odoo/entrypoint.sh | 10 +++++----- odoo/odoorc.sh | 17 +++++++++++++++++ odoo/third-party-addons.sh | 23 ++++++++++------------- 8 files changed, 50 insertions(+), 39 deletions(-) diff --git a/.env.example b/.env.example index 0d81849..0de35b9 100644 --- a/.env.example +++ b/.env.example @@ -120,7 +120,7 @@ USE_S3=false USE_SENTRY=false # Which services are going to be brought up -COMPOSE_PROFILES=base +COMPOSE_PROFILES=base,cache,storage,ssl,admin # Service profiles ODOO_PROFILES="base" @@ -320,6 +320,9 @@ CORS_ALLOWED_DOMAIN=${CORS_ALLOWED_DOMAIN} #----------------------# # 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} #-------------# diff --git a/docker-compose.override.local.yml b/docker-compose.override.local.yml index 8a9c1a6..b5363f4 100644 --- a/docker-compose.override.local.yml +++ b/docker-compose.override.local.yml @@ -19,3 +19,4 @@ services: restart: 'no' ports: - 80:80 + - 443:443 diff --git a/docker-compose.override.production.yml b/docker-compose.override.production.yml index f7e4055..bf55c5e 100644 --- a/docker-compose.override.production.yml +++ b/docker-compose.override.production.yml @@ -1,21 +1,5 @@ services: - odoo: - restart: unless-stopped - ports: - - 127.0.0.1:8069:8069 - - 127.0.0.1:8071:8071 - - 127.0.0.1:8072:8072 - - postgres: - restart: unless-stopped - ports: - - 127.0.0.1:5432:5432 - - nginx-proxy: - restart: unless-stopped - ports: - - 80:80 - - 443:443 + volumes: acme: diff --git a/docker-compose.yml b/docker-compose.yml index 35f717c..f27093c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,8 +14,9 @@ services: - ENTERPRISE_ADDONS - THIRD_PARTY_ADDONS - LOG_PATH - depends_on: - - postgres + - USE_REDIS + - USE_S3 + - USE_SENTRY tty: true volumes: - odoo-data:${DATA_DIR} @@ -161,6 +162,8 @@ services: - acme:${NGINX_ACME} - ${DOCKER_SOCK}:${DOCKER_SOCK}:ro environment: + - ACME_CA_URI + - CERTS_UPDATE_INTERVAL - DEFAULT_EMAIL networks: - internal diff --git a/odoo/Dockerfile b/odoo/Dockerfile index 7f465b4..ebeaa6e 100644 --- a/odoo/Dockerfile +++ b/odoo/Dockerfile @@ -16,6 +16,9 @@ ARG GITHUB_ACCESS_TOKEN ARG ENTERPRISE_ADDONS ARG THIRD_PARTY_ADDONS ARG ODOO_RC +ARG USE_REDIS +ARG USE_S3 +ARG USE_SENTRY ENV ODOO_TAG=${ODOO_TAG} \ LOG_PATH=${LOG_PATH} \ @@ -23,7 +26,10 @@ ENV ODOO_TAG=${ODOO_TAG} \ 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} \ + USE_SENTRY=${USE_SENTRY} #------------------------# # APT Dependencies # diff --git a/odoo/entrypoint.sh b/odoo/entrypoint.sh index 39b0753..33fa16e 100755 --- a/odoo/entrypoint.sh +++ b/odoo/entrypoint.sh @@ -25,14 +25,14 @@ case "$1" in if [ ${APP_ENV} = 'fresh' ] || [ ${APP_ENV} = 'restore' ]; then # 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 fi if [ ${APP_ENV} = 'local' ] ; then # 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} fi @@ -46,21 +46,21 @@ case "$1" in if [ ${APP_ENV} = 'testing' ] ; then # 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 --dev= --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 --dev= --stop-after-init fi if [ ${APP_ENV} = 'staging' ] ; then # 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 --dev= + 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 --dev= fi if [ ${APP_ENV} = 'production' ] ; then # 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= --update= --load=${LOAD} --workers=${WORKERS} --log-level=${LOG_LEVEL} --load-language= --without-demo=all --dev= exec odoo --config ${ODOO_RC} --database= --init= --update= --load-language= --without-demo=all --dev= fi diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index 51a2ed4..dafb911 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -20,6 +20,23 @@ while IFS='=' read -r key value || [[ -n $key ]]; do export "$key=$value" done < .env +# Check the USE_REDIS variable to decide whether to copy Redis directories +if [[ $USE_REDIS == "true" ]]; then + LOAD+=",session_redis" +fi + +# Check the USE_S3 variable to decide whether to copy S3 directories +if [[ $USE_S3 == "true" ]]; then + LOAD+=",base_attachment_object_storage,attachment_s3" +fi + +# Check if the repository directory exists and Sentry is to be used +if [[ $USE_SENTRY == "true" ]]; then + LOAD+=",sentry" +fi + +echo "Loading addons: $LOAD" + # Copy the example conf to the destination to start replacing the variables cp "$TEMPLATE_CONF" "$ODOO_RC" diff --git a/odoo/third-party-addons.sh b/odoo/third-party-addons.sh index 3873793..c562ec4 100755 --- a/odoo/third-party-addons.sh +++ b/odoo/third-party-addons.sh @@ -2,24 +2,21 @@ set -e -# Check if the repository directory exists and either Redis or S3 is to be used -if [[ ! -d "odoo-cloud-platform" && ( $USE_REDIS -eq 1 || $USE_S3 -eq 1 ) ]]; then - git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; -fi +# Always use base_attachment_object_storage +git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch $ODOO_TAG --single-branch --no-tags; +cp -r odoo-cloud-platform/base_attachment_object_storage $THIRD_PARTY_ADDONS/base_attachment_object_storage -# Check the USE_REDIS variable to decide whether to copy Redis directories -if [[ $USE_REDIS -eq 1 ]]; then - cp -r odoo-cloud-platform/session_redis ${THIRD_PARTY_ADDONS}/session_redis +if [[ $USE_REDIS == "true" ]]; then + cp -r odoo-cloud-platform/session_redis $THIRD_PARTY_ADDONS/session_redis fi # Check the USE_S3 variable to decide whether to copy S3 directories -if [[ $USE_S3 -eq 1 ]]; then - cp -r odoo-cloud-platform/base_attachment_object_storage ${THIRD_PARTY_ADDONS}/base_attachment_object_storage - cp -r odoo-cloud-platform/attachment_s3 ${THIRD_PARTY_ADDONS}/attachment_s3 +if [[ $USE_S3 == "true" ]]; then + cp -r odoo-cloud-platform/attachment_s3 $THIRD_PARTY_ADDONS/attachment_s3 fi # Check if the repository directory exists and Sentry is to be used -if [[ ! -d "server-tools" && $USE_SENTRY -eq 1 ]]; then - git clone https://github.com/odoocker/server-tools.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; - cp -r server-tools/sentry ${THIRD_PARTY_ADDONS}/sentry +if [[ $USE_SENTRY == "true" ]]; then + git clone https://github.com/odoocker/server-tools.git --depth 1 --branch $ODOO_TAG --single-branch --no-tags; + cp -r server-tools/sentry $THIRD_PARTY_ADDONS/sentry fi From 284dc6958881bca1e56ce4acd7b6e6d3451b2e34 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 00:57:28 -0500 Subject: [PATCH 06/11] cleanup --- odoo/entrypoint.sh | 17 +++++++++++++++++ odoo/odoorc.sh | 5 ++--- odoo/third-party-addons.sh | 22 ++++++++++++---------- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/odoo/entrypoint.sh b/odoo/entrypoint.sh index 33fa16e..ee70608 100755 --- a/odoo/entrypoint.sh +++ b/odoo/entrypoint.sh @@ -14,6 +14,23 @@ while IFS='=' read -r key value || [[ -n $key ]]; do eval "$key=\"$value\"" done < .env + +# Check the USE_REDIS variable to decide whether to copy Redis directories +if [[ $USE_REDIS == "true" ]]; then + LOAD+=",base_attachment_object_storage" + LOAD+=",session_redis" +fi + +# Check the USE_S3 variable to decide whether to copy S3 directories +if [[ $USE_S3 == "true" ]]; then + LOAD+=",attachment_s3" +fi + +# Check if the repository directory exists and Sentry is to be used +if [[ $USE_SENTRY == "true" ]]; then + LOAD+=",sentry" +fi + case "$1" in -- | odoo) shift diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index dafb911..886f6db 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -27,7 +27,8 @@ fi # Check the USE_S3 variable to decide whether to copy S3 directories if [[ $USE_S3 == "true" ]]; then - LOAD+=",base_attachment_object_storage,attachment_s3" + LOAD+=",base_attachment_object_storage" + LOAD+=",attachment_s3" fi # Check if the repository directory exists and Sentry is to be used @@ -35,8 +36,6 @@ if [[ $USE_SENTRY == "true" ]]; then LOAD+=",sentry" fi -echo "Loading addons: $LOAD" - # Copy the example conf to the destination to start replacing the variables cp "$TEMPLATE_CONF" "$ODOO_RC" diff --git a/odoo/third-party-addons.sh b/odoo/third-party-addons.sh index c562ec4..d101247 100755 --- a/odoo/third-party-addons.sh +++ b/odoo/third-party-addons.sh @@ -2,21 +2,23 @@ set -e -# Always use base_attachment_object_storage -git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch $ODOO_TAG --single-branch --no-tags; -cp -r odoo-cloud-platform/base_attachment_object_storage $THIRD_PARTY_ADDONS/base_attachment_object_storage +# Check if the repository directory exists and either Redis or S3 is to be used +if [[ ${USE_REDIS} == "true" || ${USE_S3} == "true" ]]; then + git clone https://github.com/odoocker/odoo-cloud-platform.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; +fi -if [[ $USE_REDIS == "true" ]]; then - cp -r odoo-cloud-platform/session_redis $THIRD_PARTY_ADDONS/session_redis +if [[ ${USE_REDIS} == "true" ]]; then + cp -r odoo-cloud-platform/session_redis ${THIRD_PARTY_ADDONS}/session_redis fi # Check the USE_S3 variable to decide whether to copy S3 directories -if [[ $USE_S3 == "true" ]]; then - cp -r odoo-cloud-platform/attachment_s3 $THIRD_PARTY_ADDONS/attachment_s3 +if [[ ${USE_S3} == "true" ]]; then + cp -r odoo-cloud-platform/base_attachment_object_storage ${THIRD_PARTY_ADDONS}/base_attachment_object_storage + cp -r odoo-cloud-platform/attachment_s3 ${THIRD_PARTY_ADDONS}/attachment_s3 fi # Check if the repository directory exists and Sentry is to be used -if [[ $USE_SENTRY == "true" ]]; then - git clone https://github.com/odoocker/server-tools.git --depth 1 --branch $ODOO_TAG --single-branch --no-tags; - cp -r server-tools/sentry $THIRD_PARTY_ADDONS/sentry +if [[ ${USE_SENTRY} == "true" ]]; then + git clone https://github.com/odoocker/server-tools.git --depth 1 --branch ${ODOO_TAG} --single-branch --no-tags; + cp -r server-tools/sentry ${THIRD_PARTY_ADDONS}/sentry fi From e26bd85abc595e78e067c36af2a2553626ea804c Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 01:00:43 -0500 Subject: [PATCH 07/11] fixed env --- .env.example | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.env.example b/.env.example index 0de35b9..b0df16c 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,9 @@ WORKERS=2 DEV_MODE=reload,xml DOMAIN=erp.odoocker.test +# Services +SERVICES=odoo,postgres,nginx,proxy + # Enterprise GITHUB_USER= GITHUB_ACCESS_TOKEN= @@ -92,7 +95,7 @@ AWS_HOST=http://s3:${S3_API_PORT} AWS_REGION= AWS_ACCESS_KEY_ID=myaccesskey AWS_SECRET_ACCESS_KEY=mysecretkey -AWS_BUCKETNAME=odoocker +AWS_BUCKETNAME=odoo-{db} # PgAdmin PGADMIN_DOMAIN=pgadmin.odoocker.test @@ -115,19 +118,19 @@ PROJECT_NAME=odoocker SUPPORT_EMAIL=mail@example.com # Service configuration -USE_REDIS=false -USE_S3=false +USE_REDIS=true +USE_S3=true USE_SENTRY=false # Which services are going to be brought up -COMPOSE_PROFILES=base,cache,storage,ssl,admin +COMPOSE_PROFILES=${SERVICES} # Service profiles -ODOO_PROFILES="base" -POSTGRES_PROFILES="base" -NGINX_PROFILES="base" -NGINX_PROXY_PROFILES="base" -ACME_COMPANION_PROFILES="ssl" +ODOO_PROFILES="odoo" +POSTGRES_PROFILES="postgres" +NGINX_PROFILES="nginx" +NGINX_PROXY_PROFILES="proxy" +ACME_COMPANION_PROFILES="acme" KEYDB_PROFILES="cache" MINIO_PROFILES="storage" PGADMIN_PROFILES="admin" From 10f3aa0302ab58a80e8072beb6b84e41765b65c4 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 01:07:27 -0500 Subject: [PATCH 08/11] fixed build --- docker-compose.override.production.yml | 24 ++++++++++++++++++++---- odoo/entrypoint.sh | 7 +++---- odoo/odoorc.sh | 8 ++++---- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/docker-compose.override.production.yml b/docker-compose.override.production.yml index bf55c5e..ccec260 100644 --- a/docker-compose.override.production.yml +++ b/docker-compose.override.production.yml @@ -1,6 +1,22 @@ services: - + odoo: + restart: 'no' + ports: + - 127.0.0.1:8069:8069 + - 127.0.0.1:8070:8070 + - 127.0.0.1:8071:8071 + - 127.0.0.1:8072:8072 -volumes: - acme: - certs: + postgres: + restart: 'no' + ports: + - 127.0.0.1:5432:5432 + + nginx: + restart: 'no' + + nginx-proxy: + restart: 'no' + ports: + - 80:80 + - 443:443 diff --git a/odoo/entrypoint.sh b/odoo/entrypoint.sh index ee70608..0750905 100755 --- a/odoo/entrypoint.sh +++ b/odoo/entrypoint.sh @@ -14,19 +14,18 @@ while IFS='=' read -r key value || [[ -n $key ]]; do eval "$key=\"$value\"" done < .env - -# Check the USE_REDIS variable to decide whether to copy Redis directories +# Check the USE_REDIS to add base_attachment_object_storage & session_redis to LOAD variable if [[ $USE_REDIS == "true" ]]; then LOAD+=",base_attachment_object_storage" LOAD+=",session_redis" fi -# Check the USE_S3 variable to decide whether to copy S3 directories +# Check the USE_REDIS to add attachment_s3 to LOAD variable if [[ $USE_S3 == "true" ]]; then LOAD+=",attachment_s3" fi -# Check if the repository directory exists and Sentry is to be used +# Check the USE_REDIS to add sentry to LOAD variable if [[ $USE_SENTRY == "true" ]]; then LOAD+=",sentry" fi diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index 886f6db..a4c7a73 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -20,18 +20,18 @@ while IFS='=' read -r key value || [[ -n $key ]]; do export "$key=$value" done < .env -# Check the USE_REDIS variable to decide whether to copy Redis directories +# Check the USE_REDIS to add base_attachment_object_storage & session_redis to LOAD variable if [[ $USE_REDIS == "true" ]]; then + LOAD+=",base_attachment_object_storage" LOAD+=",session_redis" fi -# Check the USE_S3 variable to decide whether to copy S3 directories +# 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 if the repository directory exists and Sentry is to be used +# Check the USE_REDIS to add sentry to LOAD variable if [[ $USE_SENTRY == "true" ]]; then LOAD+=",sentry" fi From 2a1ac8a17f91e15b0d7818ec599a7d7e46e661cf Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 01:09:20 -0500 Subject: [PATCH 09/11] fixed build --- odoo/entrypoint.sh | 2 +- odoo/odoorc.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/entrypoint.sh b/odoo/entrypoint.sh index 0750905..399249f 100755 --- a/odoo/entrypoint.sh +++ b/odoo/entrypoint.sh @@ -16,12 +16,12 @@ done < .env # Check the USE_REDIS to add base_attachment_object_storage & session_redis to LOAD variable if [[ $USE_REDIS == "true" ]]; then - LOAD+=",base_attachment_object_storage" 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 diff --git a/odoo/odoorc.sh b/odoo/odoorc.sh index a4c7a73..6726828 100755 --- a/odoo/odoorc.sh +++ b/odoo/odoorc.sh @@ -22,12 +22,12 @@ done < .env # Check the USE_REDIS to add base_attachment_object_storage & session_redis to LOAD variable if [[ $USE_REDIS == "true" ]]; then - LOAD+=",base_attachment_object_storage" 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 From d961bb291e6c6faa561cc8a5d7c7ba49ecd056ac Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 01:11:37 -0500 Subject: [PATCH 10/11] fixed build --- .env.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index b0df16c..601a509 100644 --- a/.env.example +++ b/.env.example @@ -131,9 +131,9 @@ POSTGRES_PROFILES="postgres" NGINX_PROFILES="nginx" NGINX_PROXY_PROFILES="proxy" ACME_COMPANION_PROFILES="acme" -KEYDB_PROFILES="cache" -MINIO_PROFILES="storage" -PGADMIN_PROFILES="admin" +KEYDB_PROFILES="keydb" +MINIO_PROFILES="minio" +PGADMIN_PROFILES="pgadmin" # Containers' Tags ODOO_TAG=16.0 From 5e21d9e76eab1c1b477b8548b143d8a79a2e6057 Mon Sep 17 00:00:00 2001 From: Yhael S Date: Fri, 20 Oct 2023 01:35:48 -0500 Subject: [PATCH 11/11] fixed build --- .env.example | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 601a509..f2092a3 100644 --- a/.env.example +++ b/.env.example @@ -12,7 +12,8 @@ DEV_MODE=reload,xml DOMAIN=erp.odoocker.test # Services -SERVICES=odoo,postgres,nginx,proxy +SERVICES=odoo,nginx,proxy,postgres +PROJECT_NAME=odoocker # Enterprise GITHUB_USER= @@ -95,7 +96,7 @@ AWS_HOST=http://s3:${S3_API_PORT} AWS_REGION= AWS_ACCESS_KEY_ID=myaccesskey AWS_SECRET_ACCESS_KEY=mysecretkey -AWS_BUCKETNAME=odoo-{db} +AWS_BUCKETNAME=${PROJECT_NAME}-{db} # PgAdmin PGADMIN_DOMAIN=pgadmin.odoocker.test @@ -114,7 +115,7 @@ PGADMIN_CONFIG_SERVER_MODE=True # Project Configurations # #------------------------------# # Docker -PROJECT_NAME=odoocker +PROJECT_NAME=${PROJECT_NAME} SUPPORT_EMAIL=mail@example.com # Service configuration