I cloned a project from GitLab that uses Docker to set up multiple services, including Odoo 16, PostgreSQL, a FastAPI backend, and a Next.js frontend.
The project works perfectly on my colleague's machine, but on my setup (macOS), and on another colleague's machine, we are facing the same issue:
The containers start successfully, and I can configure the database connection without any issues. However, when I try to access Odoo at http://localhost:8069/, I encounter the following problem:
- The login page loads without CSS.
- After entering valid credentials, I'am redirected to http://localhost:8069/web, but the page is completely blank.
What I Tried:
I attempted several fixes, but none resolved the issue:
1- Regenerating Odoo assets:
```
docker exec -it odoo bash
odoo --update=all --stop-after-init
docker-compose restart odoo
```
2- Checking permissions for mounted volumes:
```
sudo chmod -R 777 odoo_data
sudo chmod -R 777 odoo_source
sudo chmod -R 777 odoo_custom_addons
```
3- Clearing browser cache and trying in incognito mode.
4- Verifying Docker logs for errors (nothing unusual found).
docker-compose.yml (Relevant parts):
```
services:
postgres_db:
image: postgres:15
container_name: postgres_db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: xiptelecom
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init_postgres_odoo.sql:/docker-entrypoint-initdb.d/init_postgres_odoo.sql
ports:
- "5432:5432"
pgadmin:
image: dpage/pgadmin4
container_name: pgadmin4_container
restart: always
ports:
- "5050:80"
environment:
PGADMIN_DEFAULT_EMAIL: admin@admin.com
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- pgadmin_data:/var/lib/pgadmin
backend:
build:
context: ./Backend
container_name: backend
command: uvicorn main:app --host 0.0.0.0 --port 8080 --reload
volumes:
- ./Backend:/app
ports:
- "8080:8080"
depends_on:
- postgres_db
frontend:
build:
context: ./Frontend
container_name: frontend
command: "npm run dev"
volumes:
- ./Frontend:/app
ports:
- "3000:3000"
depends_on:
- backend
odoo:
image: odoo:16
container_name: odoo
depends_on:
- postgres_db
ports:
- "8069:8069"
environment:
HOST: postgres_db
USER: odoo_user # utilisateur postgres sql
PASSWORD: odoo_password # mot de passe postgres sql
DATABASE: odoo # nom de la bdd pour Odoo
MASTER_PASSWORD: admin
volumes:
- odoo_data:/var/lib/odoo
- ./odoo_source:/mnt/odoo_source # monte le dossier local
- ./odoo.conf:/etc/odoo/odoo.conf # Ajout de la configuration locale
- ./odoo_custom_addons:/mnt/extra-addons # répertoire local pour les modules Odoo personnalisés
volumes:
postgres_data:
pgadmin_data:
odoo_data:
```
odoo.conf:
```
[options]
; Infos de connexion à la bdd
db_host = postgres_db
db_port = 5432
db_user = odoo_user
db_password = odoo_password
db_name = odoo
; Configuration des modules
addons_path = /mnt/odoo_source/addons,/mnt/extra-addons
; Autres paramètres
data_dir = /var/lib/odoo
admin_passwd = $pbkdf2-sha512$600000$DAEAQKjV2jsHYKwVIoQwpg$ScuSHwYyRuGfJqbi65UUajG/kN7E5DxptFq1S.hwATMA7o/Mfx7M2dftb4VLDYmR5T1SVgCRaAcd8iHZCJ2QKQ
xmlrpc_port = 8069
longpolling_port = 8072
logfile = /var/log/odoo/odoo.log
```
Here is a well-structured post you can use for Stack Overflow:
Title:
Odoo 16 in Docker: Blank Page After Login on http://localhost:8069/web
Description:
I am running an Odoo 16 instance using Docker on macOS. My docker-compose.yml file sets up several services, including PostgreSQL, pgAdmin, a FastAPI backend, a Next.js frontend, and Odoo.
The containers start successfully, and I can configure the database connection without any issues. However, when I try to access Odoo at http://localhost:8069/, I encounter the following problem:
The login page loads without CSS.
After entering valid credentials, I am redirected to http://localhost:8069/web, but the page is completely blank.
What I Tried:
I attempted several fixes, but none resolved the issue:
Regenerating Odoo assets:
bash
Copy
Edit
docker exec -it odoo bash
odoo --update=all --stop-after-init
docker-compose restart odoo
Checking permissions for mounted volumes:
bash
Copy
Edit
sudo chmod -R 777 odoo_data
sudo chmod -R 777 odoo_source
sudo chmod -R 777 odoo_custom_addons
Clearing browser cache and trying in incognito mode.
Verifying Docker logs for errors (nothing unusual found).
docker-compose.yml (Relevant parts):
yaml
Copy
Edit
services:
odoo:
image: odoo:16
container_name: odoo
depends_on:
- postgres_db
ports:
- "8069:8069"
environment:
HOST: postgres_db
USER: odoo_user
PASSWORD: odoo_password
DATABASE: odoo
MASTER_PASSWORD: admin
volumes:
- odoo_data:/var/lib/odoo
- ./odoo_source:/mnt/odoo_source
- ./odoo.conf:/etc/odoo/odoo.conf
- ./odoo_custom_addons:/mnt/extra-addons
odoo.conf:
ini
Copy
Edit
[options]
db_host = postgres_db
db_port = 5432
db_user = odoo_user
db_password = odoo_password
db_name = odoo
addons_path = /mnt/odoo_source/addons,/mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = $pbkdf2-sha512$600000$DAEAQKjV2jsHYKwVIoQwpg$ScuSHwYyRuGfJqbi65UUajG/kN7E5DxptFq1S.hwATMA7o/Mfx7M2dftb4VLDYmR5T1SVgCRaAcd8iHZCJ2QKQ
xmlrpc_port = 8069
longpolling_port = 8072
logfile = /var/log/odoo/odoo.log
Logs & Errors:
No critical errors appear in the logs. The Odoo service starts without issues, and I can even configure the database.
Questions:
1. Why is the login page missing CSS?
2. Why do I get a blank page after login (http://localhost:8069/web)?
3. How can I debug and resolve this issue?
Any insights or troubleshooting steps would be greatly appreciated!