I'm trying to add lockout policy to parse platform docker-compose configuration, but encountering an error:
/parse-server/lib/Config.js:235
parse | throw 'Account lockout duration should be greater than 0 and less than 100000';
Here is the piece of docker-compose:
parse:
container_name: 'parse'
image: parseplatform/parse-server
restart: always
ports:
- '127.0.0.1:1337:1337'
depends_on:
- mongodb
environment:
- PARSE_SERVER_APPLICATION_ID=random_id
- PARSE_SERVER_MASTER_KEY=random_key
- PARSE_SERVER_DATABASE_URI=mongodb://mongodb/random
- PARSE_SERVER_ENABLE_ANON_USERS=false
- PARSE_SERVER_ALLOW_CUSTOM_OBJECT_ID=true
- PARSE_SERVER_MOUNT_PATH=/
- PARSE_SERVER_ACCOUNT_LOCKOUT=true
- PARSE_SERVER_ACCOUNT_LOCKOUT_DURATION=9
- PARSE_SERVER_ACCOUNT_LOCKOUT_THRESHOLD=6
Why is there an issue with duration, when it is clearly provided?
Thank you.
parse:
container_name: 'parse'
image: parseplatform/parse-server
restart: always
ports:
- '127.0.0.1:1337:1337'
depends_on:
- mongodb
environment:
- PARSE_SERVER_APPLICATION_ID=random_id
- PARSE_SERVER_MASTER_KEY=random_key
- PARSE_SERVER_DATABASE_URI=mongodb://mongodb/random
- PARSE_SERVER_ENABLE_ANON_USERS=false
- PARSE_SERVER_ALLOW_CUSTOM_OBJECT_ID=true
- PARSE_SERVER_MOUNT_PATH=/
- PARSE_SERVER_ACCOUNT_LOCKOUT={"duration":9,"threshold":6,"unlockOnPasswordReset":true}
Related
I'm trying to setup a local development with Docker Compose that has a MongoDB cluster as the database. I chose Mongo Express as the Database Admin User Interface so I can check inside the MongoDB database. It does take some time for the cluster to accept connections, I have the 3 db containers as part of the depends_on, but seems like I have to do more than that based on the Docker Compose documentation here. I can't seem to find a good example for waiting for MongoDB clusters. Has anyone figured this out already? Please share, that would be great. Thank you in advance!
Here's the docker-compose.yml file:
version: '3.9'
services:
mongodb-primary:
image: 'bitnami/mongodb:latest'
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-primary
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_ROOT_PASSWORD=password
- MONGODB_REPLICA_SET_KEY=replicasetkey
volumes:
- 'mongodb_master_data:/bitnami'
mongodb-secondary:
image: 'bitnami/mongodb:latest'
depends_on:
- mongodb-primary
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary
- MONGODB_REPLICA_SET_MODE=secondary
- MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password
- MONGODB_REPLICA_SET_KEY=replicasetkey
mongodb-arbiter:
image: 'bitnami/mongodb:latest'
depends_on:
- mongodb-primary
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter
- MONGODB_REPLICA_SET_MODE=arbiter
- MONGODB_INITIAL_PRIMARY_HOST=mongodb-primary
- MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017
- MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD=password
- MONGODB_REPLICA_SET_KEY=replicasetkey
dbadmin:
image: mongo-express
restart: always
ports:
- 8081:8081
depends_on:
- mongodb-primary
- mongodb-secondary
- mongodb-arbiter
environment:
ME_CONFIG_MONGODB_URL: mongodb://root:password#mongodb-primary:27017,mongodb-secondary:27017,mongodb-arbiter:27017?replicaSet=replicaset
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: mexpress
volumes:
mongodb_master_data:
driver: local
I have currently a problem with mongoDB and Docker:
I have this error when I compose up:
ERROR: Named volume "mongo:/data/db:rw" is used in service "mongo" but no declaration was found in the volumes section.
In fact, i realized that i have a volume instead a container but i can't access to the data or manipulate them with the mongo shell.
I have to delete an index from one mongodb collection in the volume.
How i can do that knowing that i have no container but i have a volume instead.
version: '3.1'
services:
proxy:
image: jwilder/nginx-proxy:alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- $CERT_DIR:/etc/nginx/certs
app:
image: registry.eksae.fr/talent:${VERSION:-latest}
environment:
- NEXT_PUBLIC_APP_URL
- NEXT_PUBLIC_SENTRY_DSN=${SENTRY_DSN}
- NEXT_SERVER_MONGODB_URI
- NEXT_SERVER_MONGODB_USER
- NEXT_SERVER_MONGODB_PASSWORD
- NEXT_SERVER_MONGODB_DBNAME
- NEXT_SERVER_MONGODB_DEBUG
- NEXT_SERVER_MAILER_HOST
- NEXT_SERVER_MAILER_PORT
- NEXT_SERVER_MAILER_USER
- NEXT_SERVER_MAILER_PASS
- NEXT_SERVER_MAILER_SECURE
- NEXT_SERVER_REDIS_HOST
- NEXT_SERVER_TOKEN_EXPIRE_DAYS
- SENTRY_DSN
- SENTRY_RELEASE
- SENTRY_ENVIRONMENT
- SENTRY_ORG
- SENTRY_PROJECT
- SENTRY_LOG_LEVEL
- VIRTUAL_PORT=3000
- VIRTUAL_HOST
- CERT_NAME
extra_hosts:
- s0003113:10.100.173.107
- s0003112:10.100.173.106
- s0003110:10.100.173.105
restart: always
redis:
image: redis
restart: always
volumes:
- redis:/data
volumes:
redis:
driver: local
Hi I'm trying to run mongodb to backup some files using docker images (bitnami mongodb:4.0. and mongo-express). These are specified by this docker-compose file:
version: '3.5'
services:
mongodb-primary:
image: 'bitnami/mongodb:4.0'
restart: always
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-primary
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_ROOT_PASSWORD=root
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_REPLICA_SET_KEY=replicatorkey
- MONGODB_USERNAME=project
- MONGODB_PASSWORD=pass
- MONGODB_DATABASE=project
ports:
- 27017:27017
volumes:
- ./mongo_primary:/bitnami
mongodb-secondary:
image: 'bitnami/mongodb:4.0'
restart: always
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-secondary
- MONGODB_REPLICA_SET_MODE=secondary
- MONGODB_PRIMARY_HOST=mongodb-primary
- MONGODB_PRIMARY_ROOT_PASSWORD=root
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_REPLICA_SET_KEY=replicatorkey
- MONGODB_USERNAME=project
- MONGODB_PASSWORD=pass
- MONGODB_DATABASE=project
depends_on:
- mongodb-primary
volumes:
- ./mongo_secondary:/bitnami
mongodb-arbiter:
image: 'bitnami/mongodb:4.0'
restart: always
environment:
- MONGODB_ADVERTISED_HOSTNAME=mongodb-arbiter
- MONGODB_REPLICA_SET_MODE=arbiter
- MONGODB_PRIMARY_HOST=mongodb-primary
- MONGODB_PRIMARY_ROOT_PASSWORD=root
- MONGODB_REPLICA_SET_NAME=rs0
- MONGODB_REPLICA_SET_KEY=replicatorkey
depends_on:
- mongodb-primary
mongo-express:
image: mongo-express
restart: always
environment:
- ME_CONFIG_MONGODB_SERVER="mongodb-primary,mongodb-secondary,mongodb-arbiter"
- ME_CONFIG_MONGODB_AUTH_DATABASE=project
- ME_CONFIG_REQUEST_SIZE=1024kb
- ME_CONFIG_MONGODB_ENABLE_ADMIN=true
- ME_CONFIG_MONGODB_ADMINUSERNAME=root
- ME_CONFIG_MONGODB_ADMINPASSWORD=root
- ME_CONFIG_MONGODB_AUTH_USERNAME=project
- ME_CONFIG_MONGODB_AUTH_PASSWORD=pass
- ME_CONFIG_BASICAUTH_USERNAME=admin
- ME_CONFIG_BASICAUTH_PASSWORD=admin
- ME_CONFIG_SITE_GRIDFS_ENABLED=true
depends_on:
- mongodb-primary
ports:
- 8888:8081
This docker-compose file, and the images works on a colleagues work station (kernel:4.15 and Ubuntu 18.04) but on mine (kernel: 5.3.0 Ubuntu 18.04) I get the following error message:
Admin database is not accessible
TypeError: Cannot read property 'listDatabases' of undefined
at Object.connectionData.updateDatabases (/node_modules/mongo-express/lib/db.js:41:11)
at /node_modules/mongo-express/lib/router.js:94:11
at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
at next (/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:5)
at /node_modules/express/lib/router/index.js:281:22
at param (/node_modules/express/lib/router/index.js:354:14)
at param (/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/node_modules/express/lib/router/index.js:410:3)
Going into the mongo_primary image it seems to be working fine and can connect to the mongo admin database, but it seems mongo-express can't. We've both had a look and are not sure why this is happening. Has anyone else encountered this/fixed it?
I'm using a .yml to launch an Odoo instance & its postgresql through a traefik and it works perfectly fine. It assigns the domain and subdomain with a Let's Encrypt certificate, perfect.
My issue now is that I wish to launch more of these but I haven't succeeded in doing so.
I've tried:
Changing the ports: in the odoo section
Removing the ports: section from the odoo section
Editing the ports: in the traefik section
The .yml:
version: "3"
services:
odoo:
image: odoo:12.0
depends_on:
- db
restart: unless-stopped
networks:
- internal
ports:
- "8069:8069"
- "8072:8072"
environment:
- HOST=db
- USER=${ODOO_USER}
- PASSWORD=${ODOO_PASS}
volumes:
- ./odoo/odoo-web-data:/var/lib/odoo
- ./odoo/config:/etc/odoo
- ./odoo/addons:/mnt/extra-addons
- ./odoo/logs:/var/log/odoo
labels:
- 'traefik.http.routers.odoo.rule=Host(`${ODOO_TRAEFIK_URL}`)'
- 'traefik.http.routers.odoo.entrypoints=websecure'
- 'traefik.http.routers.odoo.tls.certresolver=odoo'
- 'traefik.port=8069'
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https#docker"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
db:
image: postgres:10
restart: unless-stopped
networks:
- internal
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=${ODOO_USER}
- POSTGRES_PASSWORD=${ODOO_PASS}
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- ./pgdata:/var/lib/postgresql/data/pgdata
traefik:
image: traefik:v2.0
networks:
- internal
- web
ports:
# The HTTP port
- "80:80"
- "443:443"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
- "./traefik/letsencrypt:/letsencrypt"
- "./traefik/traefik.yml:/etc/traefik.yml"
- "/var/run/docker.sock:/var/run/docker.sock"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.defaultRule=Host(`{{ trimPrefix `/` .Name }}.${TRAEFIK_DEFAULT_DOMAIN}`)"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--certificatesResolvers.odoo.acme.httpchallenge=true"
- "--certificatesresolvers.odoo.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.odoo.acme.email=${ACME_EMAIL}"
- "--certificatesresolvers.odoo.acme.storage=/letsencrypt/acme.json"
networks:
internal:
web:
external: true
Assuming I already have a Traefik + Odoo + Postgres already running, how could I go about launching more instances of these together?
My 1st goal is to write a docker-compose.yml file with the following:
1 docker for the MariaDB server
1 docker for the PrestaShop-1.7 server
1 docker for the PHPMyAdmin server
Can you please help me get it working correctly ?
Then, my 2nd goal is to set passwords and disallow the "no password".
Kind regards,
Arnaud.
I'm using the bitnami's dockers so I've started the following script:
version: "3"
networks:
prestashop-network:
driver: bridge
services:
mariadb:
image: 'bitnami/mariadb:10.3'
environment:
- MARIADB_USER=bn_prestashop
- MARIADB_DATABASE=bitnami_prestashop
- ALLOW_EMPTY_PASSWORD=yes
networks:
- prestashop-network
volumes:
- 'mariadb_data:/bitnami'
ports:
- 3307:3306
phpmyadmin:
image: bitnami/phpmyadmin:latest
volumes:
- 'phpmyadmin_data:/bitnami'
depends_on:
- mariadb
ports:
- 81:80
environment:
- PHPMYADMIN_ALLOW_NO_PASSWORD=true
networks:
- prestashop-network
prestashop_1.7:
image: 'bitnami/prestashop:1.7'
volumes:
- 'prestashop_data:/bitnami'
- ./docker/prestashop/custom-php.ini:/usr/local/etc/php/conf.d/custom.ini
- ./docker/prestashop/phpinfo.php:/var/www/html/phpinfo.php
depends_on:
- mariadb
ports:
- 8085:80
- 8086:443
environment:
- PRESTASHOP_FIRST_NAME=Toto
- PRESTASHOP_LAST_NAME=FAMILLE
- PRESTASHOP_PASSWORD=bitnami1
- PRESTASHOP_EMAIL=user#example.com
- PRESTASHOP_HOST=localhost
- PRESTASHOP_COUNTRY=fr
- PRESTASHOP_LANGUAGE=fr
- MARIADB_HOST=mariadb
- MARIADB_PORT_NUMBER=3306
- PRESTASHOP_DATABASE_USER=bn_prestashop
- PRESTASHOP_DATABASE_NAME=bitnami_prestashop
- PRESTASHOP_DATABASE_PASSWORD=bitnami1
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_ROOT_USER=root
- MARIADB_ROOT_PASSWORD=
- MYSQL_CLIENT_CREATE_DATABASE_NAME=bitnami_prestashop
- MYSQL_CLIENT_CREATE_DATABASE_USER=bn_prestashop
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_PROTOCOL=tls
- SMTP_USER=your_email#gmail.com
- SMTP_PASSWORD=your_password
networks:
- prestashop-network
volumes:
mariadb_data:
driver: local
prestashop_data:
driver: local
phpmyadmin_data:
driver: local
For information, I use Mac OS X Mojave with the following docker tools version:
$ docker-compose version
docker-compose version 1.24.1, build 4667896b
docker-py version: 3.7.3
CPython version: 3.6.8
OpenSSL version: OpenSSL 1.1.0j 20 Nov 2018
When I launch with the following command:
docker-compose up
Then the different images are downloaded and started.
When I try to access the PhpMyAdmin instance using http://localhost:81 I can reach the PhpMyAdmin instance correctly using root and no password.
I get two major problems:
I see the 'prestashop' database is created but empty
When I try to access the PrestaShop instance using http://localhost:8085 I get an error 500
When tying your docker-compose file I got this errors:
mariadb_1 | 2019-08-15 9:28:47 13 [Warning] Access denied for user 'bn_prestashop'#'192.168.48.4' (using password: YES)
prestashop_1.7_1 | mysql-c ERROR [canConnect] Connection with 'bn_prestashop' user is unsuccessful
You need to set up the user password in the mariadb container too.
This docker-compose file worked for me, may be you can build up from here.
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:10.1'
environment:
- MARIADB_USER=bn_prestashop
- MARIADB_DATABASE=bitnami_prestashop
- MARIADB_PASSWORD=my_passwd
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- 'mariadb_data:/bitnami'
prestashop:
image: 'bitnami/prestashop:1.7'
environment:
- MARIADB_HOST=mariadb
- MARIADB_PORT_NUMBER=3306
- PRESTASHOP_DATABASE_USER=bn_prestashop
- PRESTASHOP_DATABASE_NAME=bitnami_prestashop
- PRESTASHOP_DATABASE_PASSWORD=my_passwd
- ALLOW_EMPTY_PASSWORD=yes
- PRESTASHOP_FIRST_NAME=Toto
- PRESTASHOP_LAST_NAME=FAMILLE
- PRESTASHOP_PASSWORD=bitnami1
- PRESTASHOP_EMAIL=user#example.com
- PRESTASHOP_HOST=localhost
- PRESTASHOP_COUNTRY=fr
- PRESTASHOP_LANGUAGE=fr
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_PROTOCOL=tls
- SMTP_USER=your_email#gmail.com
- SMTP_PASSWORD=your_password
ports:
- '80:80'
- '443:443'
volumes:
- 'prestashop_data:/bitnami'
depends_on:
- mariadb
phpmyadmin:
image: 'bitnami/phpmyadmin:4'
ports:
- '8080:80'
- '8443:443'
depends_on:
- mariadb
volumes:
- 'phpmyadmin_data:/bitnami'
volumes:
mariadb_data:
driver: local
prestashop_data:
driver: local
phpmyadmin_data:
driver: local