version: '3.4'
services:
db:
image: postgres:13
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/db-files/
volumes:
- ./data/db:/var/lib/postgresql/data
odoo:
build: .
depends_on:
- db
ports:
- "8069:8069"
volumes:
- ./extra-addons:/mnt/custom-addons
- ./data/odoo:/var/lib/odoo
command: ["odoo","--dev","xml,reload"]
This is my docker-compose.yml file
When I use Ubuntu, it works. But when I use MacOS, it doesn't work. The problem is command: ["odoo","--dev","xml,reload"]. When I comment it, I can run on MacOS
Please help me fix it
Related
I am trying to get a couple of containers up and running, however I am running into some issues. I run this command:
docker-compose up -d --build itvdflab
and get this error
The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services: 'itvdelab'
Unsupported config option for networks: 'itvdelabnw'
Here is the yaml file.
services:
itvdelab:
image: itversity/itvdelab
hostname: itvdelab
ports:
- "8888:8888"
volumes:
- "./itversity-material:/home/itversity/itversity-material"
- "./data:/data"
environment:
SHELL: /bin/bash
networks:
- itvdelabnw
depends_on:
- "cluster_util_db"
cluster_util_db:
image: postgres:13
ports:
- "6432:5432"
volumes:
- ./cluster_util_db_scripts:/docker-entrypoint-initdb.d
networks:
- itvdelabnw
environment:
POSTGRES_PASSWORD: itversity
itvdflab:
build:
context: .
dockerfile: images/pythonsql/Dockerfile
hostname: itvdflab
ports:
- "8888:8888"
volumes:
- "./itversity-material:/home/itversity/itversity-material"
- "./data:/data"
environment:
SHELL: /bin/bash
networks:
- itvdelabnw
depends_on:
- "pg.itversity.com"
pg.itversity.com:
image: postgres:13
ports:
- "5432:5432"
networks:
- itvdelabnw
environment:
POSTGRES_PASSWORD: itversity
networks:
itvdelabnw:
name: itvdelabnw
What changes do I need to make to get this working?
Your docker-compose.yml file is missing a version: line. Until very recently, this caused Docker Compose to interpret this as the original "version 1" Compose format, which doesn't have a top-level services: key and doesn't support Docker networks. The much newer Compose Specification claims that a version: key is optional, but in practice if you can't be guaranteed to use a very new version of Compose (built as a plugin to the docker binary) it's required. The most recent Compose file versions supported by the standalone Python docker-compose tool are 3.8 and 2.4 (you need the 2.x version for some resource-related constraints in non-Swarm installations).
# Add at the very beginning
version: '3.8'
Here is the revised copy:
version: '3.4'
services:
itvdelab:
image: itversity/itvdelab
hostname: itvdelab
ports:
- "8888:8888"
volumes:
- "./itversity-material:/home/itversity/itversity-material"
- "./data:/data"
environment:
SHELL: /bin/bash
networks:
- itvdelabnw
depends_on:
- "cluster_util_db"
cluster_util_db:
image: postgres:13
ports:
- "6432:5432"
volumes:
- ./cluster_util_db_scripts:/docker-entrypoint-initdb.d
networks:
- itvdelabnw
environment:
POSTGRES_PASSWORD: itversity
itvdflab:
build:
context: .
dockerfile: images/pythonsql/Dockerfile
hostname: itvdflab
ports:
- "8888:8888"
volumes:
- "./itversity-material:/home/itversity/itversity-material"
- "./data:/data"
environment:
SHELL: /bin/bash
networks:
- itvdelabnw
depends_on:
- "pg.itversity.com"
pg.itversity.com:
image: postgres:13
ports:
- "5432:5432"
networks:
- itvdelabnw
environment:
POSTGRES_PASSWORD: itversity
networks:
itvdelabnw:
name: itvdelabnw
and now I get the following error
ERROR: The Compose file './docker-compose.yaml' is invalid because:
services.pg.itversity.com.networks.itvdelabnw contains unsupported option: 'name'
for me work try different version. In my case work
version: '2.2'
ERROR: Encountered errors while bringing up the project.
Docker-compose up -d --build
Docker ps
------------- Docker-compose.yml -----------------
version: "3"
services:
php:
build:
context: ./docker/php
container_name: 'web'
env_file: ./docker/php/.env
restart: 'always'
ports:
- "80:80"
- "443:443"
links:
- mssql
volumes:
- ./:/var/www/html
- ./docker/config/php/php.ini:/usr/local/etc/php/php.ini
- ./docker/config/vhosts:/etc/apache2/sites-enabled
- ./docker/logs/apache2:/var/log/apache2
- ./docker/logs/php:/var/log/php
environment:
PHP_IDE_CONFIG: "serverName=local.dev.com"
mssql:
build: ./docker/mssql
container_name: 'mssql'
env_file: ./docker/mssql/.env
ports:
- "1433:1433"
volumes:
- ./docker/data/mssql:/var/opt/mssql
Make sure your port 80 isn't already in use.
Also, here's a thread with several possible solutions.
after run command docker-compose up with this configuration
compose.yml
version: '3'
volumes:
postgres_data:
driver: local
services:
bubblesassurance-postgres-keycloak:
container_name: bubblesassurance-postgres-keycloak
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- bubblesassurance-network
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_DB=keycloak
- POSTGRES_USER=keycloak
bubblesassurance-keycloak:
container_name: bubblesassurance-keycloak
image: jboss/keycloak
depends_on:
- bubblesassurance-postgres-keycloak
networks:
- bubblesassurance-network
environment:
- DB_VENDOR=POSTGRES
- DB_ADDR=bubblesassurance-postgres-keycloak
- DB_DATABASE=keycloak
- DB_USER=keycloak
- DB_PASSWORD=password
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
ports:
- 8080:8080
bubblesassurance-postgres-api:
container_name: bubblesassurance-postgres-api
image: postgres
networks:
- bubblesassurance-network
environment:
- POSTGRES_DB=bubblesassurance
- POSTGRES_USER=api
- POSTGRES_PASSWORD=BonMatinMatin
ports:
- 5432:5432
networks:
bubblesassurance-network:
driver: bridge
I have this error in consol but it's the first time I have that
bubblesassurance-keycloak | Added 'admin' to '/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json', restart server to load user
bubblesassurance-keycloak | /opt/jboss/tools/docker-entrypoint.sh: line 47: KEYCLOAK_FRONTEND_URL: unbound variable
after that Exit with code 1
but I can't understand my trouble please help me
try adding KEYCLOAK_FRONTEND_URL to your compose.yml file, in the environment definitions:
- DB_VENDOR=POSTGRES
- DB_ADDR=bubblesassurance-postgres-keycloak
- DB_DATABASE=keycloak
- DB_USER=keycloak
- DB_PASSWORD=password
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=admin
- KEYCLOAK_FRONTEND_URL=''
If you look at the entrypoint.sh scipt, it is expecting KEYCLOAK_FRONTEND_URL to be set to something.... so, try setting it and let's see what happens.
I am trying to learn how to utilize docker-compose and was following instructions until I received an error. Here's my docker-compose file.
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
images: jupyter/scipy-notebook:17aba6048f44
volume:
- ./:/home/notebook
ports:
- "8888:8888"
When I go back and enter "docker-compose up -d --build", I would get an error saying
The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.db: 'jupyter'
My docker-compose version is 1.23.2 and trying to run this on Mac. Any ideas? thanks in advance.
I'm sorry, I'm not good at English, so I'm referring to this question.
Edit it like below
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
image: jupyter/scipy-notebook:17aba6048f44
volumes:
- ./:/home/notebook
ports:
- "8888:8888"
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
image: jupyter/scipy-notebook:65761486d5d3
volumes:
- ./:/home/notebook
ports:
- "8888:8888"
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
image: jupyter/scipy-notebook:17aba6048f44 # you write "images" but actually it should be image
volume:
- ./:/home/notebook
ports:
- "8888:8888"
My docker-compose.yml looks like the below. When i run docker-compose up I get the below error.
ERROR: In file './docker-compose.yml', the service name True must be a quoted string, i.e. 'True'.
version: '3'
services:
db:
restart: always
image: postgres:9.6-alpine
container_name: pleroma_postgres
networks:
- pleroma
volumes:
- ./postgres:/var/lib/postgresql/data
web:
build: .
image: pleroma
container_name: pleroma_web
restart: always
environment:
- VIRTUAL_HOST=<myplaceholderhost>
- VIRTUAL_PORT=4000
- LETSENCRYPT_HOST=<myplaceholderhost>
- LETENCRYPT_EMAIL=<myplaceholderemail>
expose:
- "4000"
volumes:
- ./uploads:/pleroma/uploads
depends_on:
- db
nginx:
image: jwilder/nginx-proxy
container_name: nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
- /apps/docker-articles/nginx/certs:/etc/nginx/certs:ro
- /apps/docker-articles/nginx/html:/usr/share/nginx/html
restart: always
ports:
- "80:80"
- "443:443"
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
networks:
- pleroma
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion:v1.5
container_name: letsencrypt
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
- /apps/docker/articles/nginx/certs:/etc/nginx/certs:rw
- /apps/docker-articles/nginx/html:/usr/share/nginx/html
networks:
pleroma:
My docker version is
Docker version 18.06.1-ce, build e68fc7a
My docker compose version is
docker-compose version 1.23.1, build b02f1306
Running CoreOS version 1911.3.0
I ended up resolving this issue by modifying the nginx and letsencrypt portions of my docker-compose.yml file to be as follows.
nginx:
image: jwilder/nginx-proxy
container_name: nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
- /apps/docker-articles/nginx/certs:/etc/nginx/certs:ro
- /apps/docker-articles/nginx/html:/usr/share/nginx/html
restart: always
ports:
- "80:80"
- "443:443"
labels:
- "NGINX_PROXY_CONTAINER=true"
networks:
- pleroma
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion:v1.5
container_name: letsencrypt
environment:
- NGINX_PROXY_CONTAINER=true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /apps/docker-articles/nginx/vhost.d:/etc/nginx/vhost.d
- /apps/docker/articles/nginx/certs:/etc/nginx/certs:rw
- /apps/docker-articles/nginx/html:/usr/share/nginx/html
It seems "volumes_from" is deprecated in docker-compose v3. As well as I had forgotted quotes around my label and needed to set my environment within letsencrypt.
in CentOS env your .yml file directory must be /usr/local/bin