Last active
January 26, 2024 16:08
-
-
Save byk0t/a9644fd2360a9662702568459df289fc to your computer and use it in GitHub Desktop.
Docker compose for odoo:14 and PostgreSQL:13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
db: | |
image: postgres:13 | |
volumes: | |
- db-data:/var/lib/postgresql/data/pgdata | |
ports: | |
- 5432:5432/tcp | |
environment: | |
- POSTGRES_PASSWORD=odoo | |
- POSTGRES_USER=odoo | |
- POSTGRES_DB=postgres | |
- PGDATA=/var/lib/postgresql/data/pgdata | |
web: | |
image: odoo:14.0 | |
depends_on: | |
- db | |
ports: | |
- "8069:8069/tcp" | |
volumes: | |
- web-data:/var/lib/odoo | |
- ./config:/etc/odoo | |
- ./addons:/mnt/extra-addons | |
volumes: | |
db-data: | |
driver: local | |
web-data: | |
driver: local |
The gist is updated with odoo:14 and postgresql:13 versions.
I use these containers the next way:
- Create
addons
andconfig
folders - Run
sudo chmod -R 777 addons
(We need it writable from inside the docker container, for example for an odoo_bin utility) - Run
docker-compose up -d
- Generate a module
docker exec -d odoo-test_web_1 /usr/bin/odoo scaffold openacademy /mnt/extra-addons && sudo chown -R pavel:pavel addons/openacademy
(pavel
is a my user . If we don't change an owner we will not be able to edit a source code outside the container)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Pavel,
I have to rename "db" service. when I do it and change de "depends_on" in "web" container to the same new "bd" service name the container failds! it can find "db"! I think it's hard coded some where. this is the error message that I found in docker-compose logs:
psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known
Thanks for your good job!