- Enter odoo-x folder, with prompt
DOCKER COMPOSE
- Execute the next command:
docker compose up
(-d flag to execute in background) - It will run the containers and show all the logs in the console.
STEP BY STEP
docker network create customNetwork
docker run -d --name postgresql-prod --network customNetwork -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -p 5432:5432 -v postgres-data-prod:/var/lib/postgresql/data --restart always postgres:14.0
docker run -d --name postgresql-test --network customNetwork -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -p 35432:5432 -v postgres-data-test:/var/lib/postgresql/data --restart always postgres:14.0
docker build -t odoo-prod odoo-prod
docker run -d --name odoo-15-prod --network customNetwork -p 8069:8069 -p 8072:8072 -v odoo-data-prod:/opt/odoo --restart always -e DB_PORT_5432_TCP_ADDR=db-prod -e POSTGRES_HOST=postgresql-prod odoo-prod
docker build -t odoo-test odoo-test
docker run -d --name odoo-15-test --network customNetwork -p 8169:8069 -p 8172:8072 -v odoo-data-test:/opt/odoo --restart always -e DB_PORT_5432_TCP_ADDR=db-test -e POSTGRES_HOST=postgresql-test odoo-test
docker compose down
Will rollback de docker compose up (except images and volumes)docker compose up
Will build the docker compose file and will up the containersdocker compose build
Will build the docker compose
docker ps
Show running containersdocker ps -a
Show all containersdocker exec -it <container-name or id> bash
Opens the shell of the containerdocker container rm <container-name or id>
Remove the specified containerdocker create <image-name>
Create a container based on the imagedocker create --name <container-name> <image-name>
Create a container with the specified name based on the imagedocker create -p<client port>:<host port> <image-name>
Create a container with the specified ports forwardingdocker create -e <environment_variable-name=value> <image-name>
Create a container with the specifies environment variablesdocker create –network <network-name>
Create a container inside the specified networkdocker run <image-name:version>
Create a container with the specified image and show logs as –follow flag "ctrl + c" to stop container. Command workflow:- Find the image
- If the image is not locally, it will downloaded
- Create a container
- Executes the container
docker run -d <image-name:version>
Create a container, but executes in backgrounddocker start <container-id>
Execute a containerdocker stop <container-id>
Stops the containerdocker logs <container-id>
Show the logs of the specified containerdocker logs –follow <container-id>
Show the logs of the container, and waits to get more logs
docker images
List all imagesdocker image rm <image-name:version>
Remove imagedocker build -t <image-name:tag> <path dockerfile>
Based on Dockerfile, build an imagedocker pull <image-name:version>
Download an image
docker network ls
List all networksdocker network create <network-name>
Create a custom Networkdocker network rm <network-name>
Removes the network
docker volume create <volume-name>
Create a volumedocker volume ls
List all volumesdocker volume inspect <volume-name>
Display detailed information on one or more volumesdocker volume rm <volume-name>
Remove one or more volumes