Skip to content

Instantly share code, notes, and snippets.

View milianoo's full-sized avatar
💭
Life is On

Milad Rezazadeh milianoo

💭
Life is On
View GitHub Profile
@milianoo
milianoo / .bash_profile
Created January 1, 2019 22:08
A friendly bash_profile with git branches
# -------------------------------
# 1. COMMAND PROMPT CONFIGURATION
# -------------------------------
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Change Prompt
# ------------------------------------------------------------
connect to docker container bash :
docker exec -it teamcity_mysql_1 bash
access mysql shell:
mysql -p<password>
Note: -p<password> is not a typo and it supposed to be like this
execute below commands on mysql shell :
create database teamcity_01 collate utf8_bin;
# Team City Docker File
version: '2'
services:
mysql:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: 'test_pass' # TODO: Change this
@milianoo
milianoo / Deploy nginx using docker
Last active June 20, 2017 14:22
Deploy Nginx using Docker Containers
1. get latest image of nginx
sudo docker pull nginx
2. run nginx image
sudo docker run --name some-nginx -d -p 80:80 nginx
Note : added the -d flag to run the container in the background (detached mode).
3.1 If you are using Azure, make sure to allow http inbound traffic on port 80.
Network Secutiry Group > Inbound Security rules > allow port 80
@milianoo
milianoo / Run MongoDb using Docker
Last active June 19, 2017 08:36
Run mongodb instance using docker containers in your local system
1. Install Docker.
please follow docker tutorial for installation on your system
https://docs.docker.com/engine/installation/
2. Now there are two options to run Mongodb
2.1 Create your own Dockerfile
2.2 Use existing images available on Docker-Hub
3. Run existing image on docker hub :
`docker run -p 27017 --name mongodb_01 -d mongo`