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
| # Single quotes are relevant to delay expansion to be executed in container shell session | |
| # 1. using docker exec: | |
| cat /path/to/file.sql | docker exec -i <running postgres container name> \ | |
| bash -c 'PGPASSWORD=${POSTGRES_PASSWORD} psql -U ${POSTGRES_USER} -d ${POSTGRES_DB}' | |
| # 2. using docker compose exec | |
| cat /path/to/file.sql | docker compose exec -i <service name in docker-compose.yml> \ | |
| bash -c 'PGPASSWORD=${POSTGRES_PASSWORD} psql -U ${POSTGRES_USER} -d ${POSTGRES_DB}' | |
| # You can also use `docker compose exec`: | |
| # docker compose exec -i <service name in docker-compose.yml> bash -c '...' < /path/to/file.sql |
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
| <?php | |
| /** | |
| * ------------------------------------------------ | |
| * Encrypt PHP session data using files | |
| * ------------------------------------------------ | |
| * The encryption is built using mcrypt extension | |
| * and the randomness is managed by openssl | |
| * The default encryption algorithm is AES (Rijndael-128) | |
| * and we use CBC+HMAC (Encrypt-then-mac) with SHA-256 |