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