-it- Execute using "interactive tty", i.e. execute the command and hold the session until the command ends (with possible keyboard input).
-p 8080:3000- Bind the port 3000 from the container to the local network interface on port 8080. The port that is closer to the container image name (see below) is the one that refers to the container port, the other one refers to the local network port.
-d- Run the container as daemon (instead of interactively with
-it).
- Run the container as daemon (instead of interactively with
-v /opt/postgres/data:/var/lib/postgresql/data- Attach a local volume to a container for data persistance. Follow the same logic as with the ports to know which one refers to the container and which one to the local filesystem.
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
| ################### | |
| # Docker COMMANDS # | |
| ################### | |
| # Create volume for persistance | |
| docker volume create pgdata | |
| # Create the container | |
| docker run --name pg -e POSTGRES_USER=test -e POSTGRES_PASSWORD=test -d -v pgdata:/var/lib/postgresql/data -p 5432:5432 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
| # Terminal | |
| # OLD -> rails new app_name -T --webpack=stimulus --skip-sprockets | |
| rails new app_name -a propshaft --skip-jbuilder -T | |
| cd app/ | |
| # OLD -> yarn add bootstrap jquery popper.js | |
| # Basic Gemfile (DOWN BELOW) | |
| # Terminal |
-
Check for the WiFi dongle (making sure it's available) with
dmesg | more -
Edit
/etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
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
| ``` | |
| heroku restart -a APP_NAME | |
| heroku pg:reset -a APP_NAME DATABASE --confirm=APP_NAME | |
| heroku run rake db:migrate -a APP_NAME | |
| heroku run rake db:seed -a APP_NAME | |
| ``` | |
| One liner: | |
| `heroku restart -a APP_NAME; heroku pg:reset -a APP_NAME DATABASE --confirm=APP_NAME; heroku run rake db:migrate -a APP_NAME; heroku run rake db:seed -a APP_NAME` |
heroku restart -a APP_NAME
heroku pg:reset -a APP_NAME DATABASE --confirm=APP_NAME
heroku run rake db:migrate -a APP_NAME
heroku run rake db:seed -a APP_NAME
One liner:
heroku restart -a APP_NAME; heroku pg:reset -a APP_NAME DATABASE --confirm=APP_NAME; heroku run rake db:migrate -a APP_NAME; heroku run rake db:seed -a APP_NAME
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
| heroku run DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rake --trace db:schema:load | |
| heroku run rake --trace db:migrate | |
| heroku run rake --trace db:seed |
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
| # Find PID of process | |
| lsof -n -i4TCP:3000 | |
| kill -9 [PID] |
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
| vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*' |