Software Development

Containerize WordPress Using Docker

For Single Site without Proxy: docker-compose.yml version: '3.3' services: web: image: wordpress restart: always depends_on: - mysql links: - mysql expose: - 80 ports: - 80:80 environment: - WORDPRESS_DB_NAME=db_name - WORDPRESS_TABLE_PREFIX=wp_ - WORDPRESS_DB_HOST=mysql - WORDPRESS_DB_PASSWORD=db_wordpress_user_password - WORDPRESS_DB_USER=db_wordpress_user - VIRTUAL_HOST=x.example.com volumes: - ./html:/var/www/html networks: - wordpress-network mysql: image: mysql command: --default-authentication-plugin=mysql_native_password container_name: mysql restart: always volumes: - ./mysql:/var/lib/mysql environment: -

Installing Docker and Docker-Compose on Ubuntu

Docker apt-get update apt-get install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - apt-key fingerprint 0EBFCD88 add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" apt-get update apt-get install docker-ce docker

Database

MS SQL Server Cheatsheet

Reseeding a table identity in MS SQL Server DBCC CHECKIDENT (tablename, RESEED, new_reseed_value) Truncate Table truncate tablename Check Log size of all database DBCC SQLPERF(LOGSPACE);   Connection String Standard Security: 1. Server=ServerNameOrIpAddress;Database=DatabaseName;User Id=Username; Password=Password; Trusted

MySQL Cheatsheet

Login to MySql: mysql -u username -p password Create Database: create database databasename character set utf8 collate utf8_general_ci; grant all on databasename.* to databaseUser@'localhost' identified by 'password'; Delete Database: drop database

Top