Maxmind offers multiple ip-geolocalization databases, historically we have been using the City database which contains records on a city-basis. Many years later it turns out we are primary using geoip to know the country of the user. Geolocalization in the City database is considered slow by our standard and we have been clever in order not to geolocate each request by saving the info in the session. On the other hand, the Country database that is offered by Maxmind is much more lightweight and geoip using that country is considered a fast operation by our standard. In this work we make Odoo compatible with both the City and the Country databases. Using multiple database at the same time, we can be smart and only query each of the two on-demand. If a user ask for its country, we'll use the fast Country db. If a user ask for its city/timezone we'll use the slower City db. By default it loads both database from the `/usr/share/GeoIP/` folder, respectively the files `GeoLite2-City.mmdb` and `GeoLite2-Country.mmdb`, you can provide alternative paths using the `--geoip-city-db` and `--geoip-country-db` CLI options. In the same mindset as #86015, geoip is still lazy. It is done on-demand and the result is cached on the current request. The different with the related PR is that as we know consider geoip to be fast, we no longer cache the result in the session. Task: 2848206 Part-of: odoo/odoo#91337
69 lines
1.8 KiB
Plaintext
69 lines
1.8 KiB
Plaintext
# Please note that this Dockerfile is used for testing nightly builds and should
|
|
# not be used to deploy Odoo
|
|
FROM fedora:36
|
|
MAINTAINER Odoo S.A. <info@odoo.com>
|
|
|
|
# Dependencies and postgres
|
|
RUN dnf update -d 0 -e 0 -y && \
|
|
dnf install -d 0 -e 0 \
|
|
createrepo \
|
|
libsass \
|
|
postgresql \
|
|
postgresql-contrib \
|
|
postgresql-devel \
|
|
postgresql-libs \
|
|
postgresql-server \
|
|
python3-PyPDF2 \
|
|
python3-cryptography \
|
|
python3-babel \
|
|
python3-chardet \
|
|
python3-dateutil \
|
|
python3-decorator \
|
|
python3-devel \
|
|
python3-docutils \
|
|
python3-freezegun \
|
|
python3-geoip2 \
|
|
python3-gevent \
|
|
python3-greenlet \
|
|
python3-idna \
|
|
python3-jinja2 \
|
|
python3-libsass \
|
|
python3-lxml \
|
|
python3-markupsafe \
|
|
python3-mock \
|
|
python3-num2words \
|
|
python3-ofxparse \
|
|
python3-passlib \
|
|
python3-pillow \
|
|
python3-polib \
|
|
python3-psutil \
|
|
python3-psycopg2 \
|
|
python3-pydot \
|
|
python3-pyldap \
|
|
python3-pyOpenSSL \
|
|
python3-pyserial \
|
|
python3-pytz \
|
|
python3-pyusb \
|
|
python3-qrcode \
|
|
python3-reportlab \
|
|
python3-requests \
|
|
python3-six \
|
|
python3-stdnum \
|
|
python3-vobject \
|
|
python3-werkzeug \
|
|
python3-wheel \
|
|
python3-xlrd \
|
|
python3-xlsxwriter \
|
|
python3-xlwt \
|
|
python3-zeep \
|
|
rpmdevtools -y && \
|
|
dnf clean all
|
|
|
|
# Postgres configuration
|
|
RUN mkdir -p /var/lib/postgres/data
|
|
RUN chown -R postgres:postgres /var/lib/postgres/data
|
|
RUN su postgres -c "initdb -D /var/lib/postgres/data -E UTF-8"
|
|
RUN cp /usr/share/pgsql/postgresql.conf.sample /var/lib/postgres/data/postgresql.conf
|
|
|
|
RUN echo "PS1=\"[\u@nightly-tests] # \"" > ~/.bashrc
|