Danh mục: Docker

  • docker-compose yarn dev with port export

    docker-compose run –rm –service-ports app yarn

  • docker – docker-compose run export port

    docker-compose run –rm –service-ports app yarn start:dev

  • Moving server with docker, rsync

    sudo docker ps #Show container id #chat service sudo docker exec -i {CONTAINER_ID} /usr/bin/mongodump –uri “mongodb://” –archive > /mnt/storage/mongodb.dump sudo docker exec -i {CONTAINER_ID} /usr/bin/mongorestore –uri “mongodb://” –archive –drop < /mnt/storage/mongodb.dump #database sudo docker exec -i {CONTAINER_ID} mysql -uhanda -p{PASSWORD} handa < /mnt/storage/database.sql #storage log sudo rsync -avh target_server:/var/www/storage/ /mnt/storage/

  • Increasing fs.inotify.max_user_watches for Docker images

    Increasing fs.inotify.max_user_watches for Docker images TL;DR You can’t set those for an image during build time becasue Docker takes the sysctl configuration from the Host. So, set the config on your host machine. As in this link, to increase the maximum watchers, we need set fs.inotify.max_user_watches to a higher number in /etc/sysctl.conf. $ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p So,…

  • mongodb dump – restore docker

    Dump: sudo docker exec -i <container_name> /usr/bin/mongodump –uri “mongodb://” –archive > /mnt/storage/mongodb.dump Restore sudo docker exec -i <container_name> /usr/bin/mongorestore –uri “mongodb://” –archive < /mnt/storage/mongodb.dump

  • Docker cache

    docker system df docker ps -q

  • docker

    docker-compose down docker in background: docker-compose up -d Run docker container: docker-compose run {DOCKER CONTAINER NAME} Example: docker-compose run artisan migrate # Create tmp container for run Exec command: docker-compose exec {DOCKER CONTAINER NAME} Example: docker-compose exec php php artisan config:cache # Run in running container Docker build or rebuild: docker-compose up –build Docker chown:…