Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] External connection to db for test instance #508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,20 @@ postgres_cidr_whitelist:

⚠️ It must be a list. And this is only supported if you deploy with Traefik 2+.

postgres_exposed_test:
default: false
type: bool
help: >-
Do you also want to expose database service for demo?

postgres_exposed_port_test:
default: 5432
type: int
when: &db_exposed_test "{{ postgres_exposed and traefik_version != 3 }}"
help: >-
Indicate the port to connect to the demo database.. It must not be de same of
production database port

odoo_dbfilter:
default: "^{{ postgres_dbname }}"
type: str
Expand Down
21 changes: 21 additions & 0 deletions test.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{%- import "_traefik1_labels.yml.jinja" as traefik1_labels -%}
{%- import "_traefik2_labels.yml.jinja" as traefik2_labels -%}
{%- import "_traefik3_labels.yml.jinja" as traefik3_labels -%}
{%- import "_traefik3_paths_labels.yml.jinja" as traefik3_labels_2 -%}
{%- set _key = traefik2_labels.key(project_name, odoo_version, "test") -%}
version: "2.4"

Expand Down Expand Up @@ -59,6 +60,26 @@ services:
env_file:
- .docker/db-creation.env
restart: unless-stopped
{%- if postgres_exposed_test %}
{%- if traefik_version == 3 %}
networks:
default:
inverseproxy_shared:
labels:
traefik.enable: "true"
traefik.docker.network: "inverseproxy_shared"
{{- traefik3_labels_2.database(
domains_test,
postgres_cidr_whitelist,
_key,
postgres_exposed_port_test,
project_name,
) }}
{%- else %}
ports:
- "{{ postgres_exposed_port_test }}:5432"
{%- endif %}
{%- endif %}
{%- endif %}

smtp:
Expand Down
Loading