Step:1 Check Docker Version
docker --version
docker compose version
Step:2 Installs a default Linux Distributions and enables required Windows features
wsl --install
Wsl --status
Wsl --update
Step:3 Create a folder as odoo docker and inside that create a yaml file and paste the below content
#Odoo-docker-directory
#├── addons
#├── config
#│ └── odoo.conf
#├── docker-compose.yaml
#├── odoo_pg_pass
#└── sessions
# Create a config file inside the config directory with the following content
# [options]
# addons_path = /mnt/extra-addons
# docker-compose.yaml
version: '3.1'
services:
web:
image: odoo:latest
depends_on:
- db
restart: always
ports:
- "8069:8069"
- "8072:8072"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
environment:
- PASSWORD_FILE=/run/secrets/postgresql_password
secrets:
- postgresql_password
db:
image: postgres:latest
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
restart: always
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
secrets:
- postgresql_password
volumes:
odoo-web-data:
odoo-db-data:
# Create a file named odoo_pg_pass in the same directory and enter your database password for odoo
secrets:
postgresql_password:
file: odoo_pg_pass
Add another file as odoo_pg_pass and type your postgresql password and save it
Step:4 Run the below command within the odoo docker folder
docker compose up -d
then it runs and open the odoo.
Step:5 Stop
docker compose down
Step:6 Restart
docker compose restart web
Step:7 View Log File
docker compose logs -f