Docker
https://subicura.com/2017/01/19/docker-guide-for-beginners-2.html
$ curl -s https://get.docker.com/ | sudo sh
권한 추가
# 현재 접속중인 사용자에게 권한주기 $ sudo usermod -aG docker $USER # your-user 사용자에게 권한주기 $ sudo usermod -aG docker your-user
$ docker version $ docker ps -a
_______________________
Docker Compose
https://docs.docker.com/compose/install/#upgrading
$ sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose $ sudo chmod +x /usr/local/bin/docker-compose $ docker-compose --version
_______________________
WordPress
$ mkdir wordpress $ cd wordpress $ vim docker-compose.yml
version: '3' services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: somewordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress volumes: db_data:version: '2' services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress wordpress: depends_on: - db image: wordpress:latest volumes: - wp_data:/var/www/html ports: - "8000:80" restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_PASSWORD: wordpress volumes: db_data: wp_data:
https://docs.docker.com/compose/wordpress/#shutdown-and-cleanup
$ docker-compose up -d
ip주소:8000 로 접속
At this point, WordPress should be running on port 8000 of your Docker Host, and you can complete the “famous five-minute installation” as a WordPress administrator.