This file contains 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 save postgres10 > postgres10.tar | |
docker load postgres10 < postgres10.tar | |
docker volume create postgres | |
docker run -d -it -v postgres:/var/lib/postgresql/10/main -p 5433:5432 postgres10 bash | |
docker exec -it $(docker ps --format "{{.ID}}") bash service postgresql restart |
This file contains 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' | |
services: | |
postgres: | |
image: posgtres10:latest | |
restart: always | |
ports: | |
- 5433:5432 | |
volumes: | |
- postgres:/var/lib/postgresql/10/main |
This file contains 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 run -it postgres10 bash | |
ln -s /tmp/.s.PGSQL.5432 /var/run/postgresql/.s.PGSQL.5432 | |
su - postgres | |
psql | |
create user postgres password 'postgres'; | |
alter user postgres with superuser; | |
create database postgres WITH owner=postgres encoding='UTF8'; |
This file contains 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 build -t postgres10 . | |
docker run -d -it -v postgres:/var/lib/postgresql/10/main -p 5433:5432 postgres10 bash | |
docker exec -it $(docker ps --format "{{.ID}}") bash service postgresql restart |
This file contains 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
mkdir postgres-persistent | |
cd postgres-persistent | |
touch Dockerfile docker-compose.yml run.sh | |
sudo docker volume create postgres |
This file contains 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
FROM ubuntu:latest | |
WORKDIR /postgres-persistent | |
ADD . /postgres-persistent | |
RUN apt-get update -y | |
RUN apt-get install -y apt-transport-https apt-utils | |
RUN apt-get install vim -y | |
RUN apt-get install postgresql-10 -y | |
EXPOSE 5432 |
This file contains 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 apt-get install docker.io | |
sudo apt-get install docker-compose |
This file contains 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
calculateAge(1985); | |
function calculateAge(year) { | |
console.log(2016 - year); | |
console.log(this); //First 'this' | |
} | |
var john = { | |
name: 'John', | |
yearOfBirth: 1990, |
This file contains 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
var obj = { | |
count: 0, | |
cool: function coolFn() { | |
if (this.count < 1) { | |
setTimeout( () => { // arrow-function ftw? | |
this.count++; | |
console.log( "awesome?" ); | |
}, 100 ); | |
} | |
} |
This file contains 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
var a = 'Hello!'; | |
first(); | |
function first() { | |
var b = 'Hi'; | |
second(); | |
function second() { | |
var c = 'Hey!'; | |
third(); |
NewerOlder