Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Environment variables for PostgreSQL containers | |
| x-default-pg-env: &default-pg-env | |
| # Set the timezone to Asia/Bangkok | |
| TZ: Asia/Bangkok | |
| # Username for the PostgreSQL administrative account | |
| POSTGRESQL_USERNAME: postgres | |
| # Name of the default PostgreSQL database | |
| POSTGRESQL_DATABASE: postgres | |
| # Password for the PostgreSQL administrative account | |
| POSTGRESQL_PASSWORD: mysecretpassword |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install: | |
| https://kienngd.github.io/how-to-use-zram-on-ubuntu-2404/ | |
| FixUp: | |
| https://manpages.ubuntu.com/manpages/xenial/man8/zramctl.8.html | |
| https://askubuntu.com/questions/730749/how-to-change-zram-size | |
| Commands: | |
| # swapoff /dev/zram0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.4" | |
| networks: | |
| example-com--postgres: ~ | |
| example-com--redis: ~ | |
| services: | |
| # PostgreSQL | |
| postgres: | |
| container_name: example-com--postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| network: | |
| version: 2 | |
| ethernets: | |
| ens33: | |
| dhcp4: no | |
| addresses: | |
| - 192.168.1.10/24 | |
| gateway4: 192.168.1.1 | |
| nameservers: | |
| addresses: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Get a list of all Docker volume names | |
| volume_names=$(docker volume ls --quiet) | |
| # Iterate through each volume and print its name and size | |
| for volume_name in $volume_names; do | |
| volume_path=$(docker volume inspect --format '{{ .Mountpoint }}' $volume_name) | |
| volume_size=$(du -sh $volume_path | cut -f1) | |
| echo "Volume: $volume_name, Size: $volume_size" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Find and clean large Docker container log files | |
| logs=$(find /var/lib/docker/containers/ -type f -name "*.log") | |
| for log in $logs; do | |
| size=$(du -m "$log" | cut -f1) | |
| if [ $size -gt 10 ]; then | |
| echo "Cleaning up large log file: $log" | |
| truncate -s 0 "$log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| sudo curl -L https://raw.githubusercontent.com/docker/compose/1.29.2/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Topic: Is it possible to show the restart policy of a running Docker container | |
| # Reference: | |
| https://stackoverflow.com/questions/43108227/is-it-possible-to-show-the-restart-policy-of-a-running-docker-container | |
| # Solution: | |
| docker ps|grep -v CON|awk '{print $1}'|while read line; do docker inspect -f "{{ .HostConfig.RestartPolicy.Name }}" $line |xargs echo $line ;done |
NewerOlder