Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
seungwonme committed May 24, 2024
1 parent 4ce20d7 commit 80177c2
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 62 deletions.
27 changes: 11 additions & 16 deletions docker/inception/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[Docker Compose를 이용하여 워드프레스 설치하기 > 우분투 서버 | 우성짱의 NAS](https://www.wsgvet.com/bbs/board.php?bo_table=ubuntu&wr_id=97)

[custom setup](https://codingwithmanny.medium.com/custom-wordpress-docker-setup-8851e98e6b8)


[WordPress Installation](https://www.hostinger.com/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu/?ppc_campaign=google_search_generic_hosting_all&bidkw=defaultkeyword&lo=1009871)

[Setup WordPress on Ubuntu 22.04 with Nginx and MariaDB | Works With The Web](https://www.workswiththeweb.com/wordpress/2024/01/14/Setup-WordPress-Ubuntu-Nginx/)

- [Docker Compose를 이용하여 워드프레스 설치하기 > 우분투 서버 | 우성짱의 NAS](https://www.wsgvet.com/bbs/board.php?bo_table=ubuntu&wr_id=97)
- [custom setup](https://codingwithmanny.medium.com/custom-wordpress-docker-setup-8851e98e6b8)
- [Setup WordPress on Ubuntu 22.04 with Nginx and MariaDB | Works With The Web](https://www.workswiththeweb.com/wordpress/2024/01/14/Setup-WordPress-Ubuntu-Nginx/)
- [docker-compose syntex](https://nirsa.tistory.com/79)
- [Dockerfile](https://adjh54.tistory.com/414)
- [docker-compose: difference between networks and links - Stack Overflow](https://stackoverflow.com/questions/41294305/docker-compose-difference-between-networks-and-links)
- [Docker Volume Tutorial](https://seosh817.tistory.com/374)

Docker 볼륨 내의 컨텐츠를 확인하는 방법 중 하나는 Docker 컨테이너를 사용하여 해당 볼륨을 마운트하고, 그 내부를 탐색하는 것입니다. 위에서 제공된 출력을 바탕으로, `srcs_dbdata` 볼륨 안의 컨텐츠를 확인하는 방법을 설명하겠습니다.

Expand Down Expand Up @@ -48,10 +46,7 @@ ls -l

이 방법을 사용하면 별도의 서비스 중단 없이 Docker 볼륨 내의 데이터를 안전하게 탐색하고 관리할 수 있습니다.

이런 자료를 참고했어요.
[1] Learn Microsoft - 볼륨 인식 방법 - Windows drivers (https://learn.microsoft.com/ko-kr/windows-hardware/drivers/ifs/how-the-volume-is-recognized)
[2] Autodesk - Flame에 대한 vic(볼륨 무결성 확인) 사용 방법 (https://www.autodesk.co.kr/support/technical/article/caas/sfdcarticles/sfdcarticles/KOR/Using-vic-Volume-Integrity-Check.html)
[3] AWS Documentation - Amazon EBS 볼륨에 대한 정보 보기 (https://docs.aws.amazon.com/ko_kr/ebs/latest/userguide/ebs-describing-volumes.html)
[4] Microsoft Community - 사내 전체 볼륨 라이센스 제품키 확인 (https://answers.microsoft.com/ko-kr/windows/forum/all/%EC%82%AC%EB%82%B4-%EC%A0%84%EC%B2%B4/079b4530-5b1b-4025-b410-334cf6cf55e7)

뤼튼 사용하러 가기 > https://agent.wrtn.ai/5xb91l
- [1 Learn Microsoft - 볼륨 인식 방법 - Windows drivers ](https://learn.microsoft.com/ko-kr/windows-hardware/drivers/ifs/how-the-volume-is-recognized)
- [2 Autodesk - Flame에 대한 vic(볼륨 무결성 확인) 사용 방법](https://www.autodesk.co.kr/support/technical/article/caas/sfdcarticles/sfdcarticles/KOR/Using-vic-Volume-Integrity-Check.html)
- [3 AWS Documentation - Amazon EBS 볼륨에 대한 정보 보기](https://docs.aws.amazon.com/ko_kr/ebs/latest/userguide/ebs-describing-volumes.html)
- [4 Microsoft Community - 사내 전체 볼륨 라이센스 제품키 확인](https://answers.microsoft.com/ko-kr/windows/forum/all/%EC%82%AC%EB%82%B4-%EC%A0%84%EC%B2%B4/079b4530-5b1b-4025-b410-334cf6cf55e7)
7 changes: 1 addition & 6 deletions docker/inception/srcs/requirements/mariadb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# https://github.com/yobasystems/alpine-mariadb/blob/master/alpine-mariadb-aarch64/Dockerfile

# Base image
FROM alpine:3.18

RUN apk update && \
Expand All @@ -10,15 +8,12 @@ RUN apk update && \
touch /var/log/mysql/error.log && \
chown -R mysql:mysql /var/log/mysql/

EXPOSE 3306

COPY tools/run.sh /scripts/run.sh
COPY conf/mariadb-server.cnf /etc/my.cnf.d/mariadb-server.cnf

RUN chmod -R 755 /scripts

# HEALTHCHECK --start-period=5m \
# CMD mariadb -e 'SELECT @@datadir;' || exit 1
EXPOSE 3306

VOLUME ["/var/lib/mysql"]

Expand Down
4 changes: 1 addition & 3 deletions docker/inception/srcs/requirements/mariadb/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# MariaDB Container

[MariaDB - Alpine Linux](https://wiki.alpinelinux.org/wiki/MariaDB)
[MariaDB](https://mariadb.com/kb/en/creating-a-custom-container-image/)

[Mysql 사용자 조회/추가/생성/삭제](https://technote.kr/32)
[SQL 기초 & 자주쓰는 쿼리문 정리](https://365kim.tistory.com/102)
[Create a new MariaDB database and user](https://docs.bitnami.com/virtual-machine/apps/wordpress/configuration/create-database-mariadb/)

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://wiki.alpinelinux.org/wiki/MariaDB
# https://docs.3rdeyesys.com/docs/database/mysql-mariadb/configure/config-file-my-cnf-position/
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
Expand Down
3 changes: 3 additions & 0 deletions docker/inception/srcs/requirements/mariadb/tools/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ DROP DATABASE IF EXISTS test ;
FLUSH PRIVILEGES ;
EOF

# https://dev.mysql.com/doc/refman/8.3/en/mysqld.html
# https://mariadb.com/resources/blog/using-mysql_embedded-and-mysqld-bootstrap-to-tinker-with-privilege-tables/
# https://docs.oracle.com/cd/E17952_01/mysql-5.7-en/server-options.html
/usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < $tfile
# rm -f $tfile
fi
Expand Down
1 change: 1 addition & 0 deletions docker/inception/srcs/requirements/nginx/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Nginx Container

[Nginx - Alpine Linux](https://wiki.alpinelinux.org/wiki/Nginx)
[SSL,TLS 프로토콜 버전 확인/테스트 방법 (서버,웹브라우저) - SecureSign](https://www.sslcert.co.kr/guides/kb/88)
15 changes: 9 additions & 6 deletions docker/inception/srcs/requirements/wordpress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# https://github.com/docker-library/wordpress/blob/2eba26f088c12dea179623ee8af5cb52e6f60c4a/latest/php8.1/fpm-alpine/Dockerfile
# https://wiki.alpinelinux.org/wiki/WordPress
# https://docs.rockylinux.org/guides/web/php/
# https://www.php.net/manual/en/mysqli.overview.php
# https://dev.mysql.com/downloads/connector/php-mysqlnd/
# https://inpa.tistory.com/entry/PHP-%F0%9F%93%9A-DB-%EB%8B%A4%EB%A3%A8%EA%B8%B0-mysqli-%EB%B0%A9%EC%8B%9D
FROM alpine:3.18

EXPOSE 9000

RUN apk update && \
apk add --no-cache git php-fpm php-mysqli php-mysqlnd
apk add --no-cache php-fpm php-mysqli git

RUN wget https://wordpress.org/latest.tar.gz -O /tmp/latest.tar.gz && \
mkdir -p /var/www/html && \
tar -xzf /tmp/latest.tar.gz && \
mkdir -p /var/www/html && \
mv wordpress/* /var/www/html/ && \
rm -f /tmp/latest.tar.gz && \
mkdir wp-content && \
chmod -R 1777 wp-content
rm -f /tmp/latest.tar.gz

COPY conf/www.conf /etc/php81/php-fpm.d/www.conf
COPY conf/php.ini /etc/php81/php.ini
Expand Down
30 changes: 0 additions & 30 deletions docker/inception/srcs/requirements/wordpress/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
# Wordpress Container

- [WordPress - Alpine Linux](https://wiki.alpinelinux.org/wiki/WordPress)
- [WordPress Installation](https://www.hostinger.com/tutorials/-how-to-install-wordpress-with-nginx-on-ubuntu/?ppc_campaign=google_search_generic_hosting_all&bidkw=defaultkeyword&lo=1009871)
- [custom-wordpress-docker-setup](https://codingwithmanny.medium.com/custom-wordpress-docker-setup-8851e98e6b8)


php-mysqli와 php-mysqlnd는 PHP에서 MySQL 데이터베이스를 사용하기 위한 확장 모듈입니다. 각각은 MySQL 데이터베이스와의 상호작용을 가능하게 하는 다른 기능과 특성을 가지고 있습니다.

`php-mysqli``php-mysqlnd`는 PHP에서 MySQL 데이터베이스를 사용하기 위한 확장 모듈입니다. 각각은 MySQL 데이터베이스와의 상호작용을 가능하게 하는 다른 기능과 특성을 가지고 있습니다.

### php-mysqli

- `mysqli`는 "MySQL Improved"의 약자입니다. 이 확장은 PHP 5 이상에서 MySQL 데이터베이스를 사용할 때 권장되는 방법입니다.
- `mysqli` 확장은 객체 지향 및 절차적 인터페이스를 모두 제공하여 MySQL 데이터베이스와의 상호작용을 지원합니다.
- 이 확장은 MySQL 4.1 이상에서 도입된 새로운 기능들, 예를 들어, 준비된 문장(prepared statements), 다중 쿼리(multi queries), 트랜잭션(transaction) 등을 지원합니다.

### php-mysqlnd

- `mysqlnd`는 "MySQL Native Driver"의 약자입니다. 이 확장은 PHP 언어에 대한 MySQL 데이터베이스의 기본 드라이버입니다.
- `mysqlnd`는 PHP의 일부로 직접 컴파일되어, PHP 애플리케이션과 MySQL 데이터베이스 간의 통신을 위한 중간 레이어 없이 데이터베이스에 직접 접근할 수 있게 합니다. 이로 인해 성능이 향상되고 메모리 사용이 감소될 수 있습니다.
- `mysqlnd``mysqli`와 PDO_MySQL 확장을 위한 백엔드 드라이버로 사용됩니다. 따라서, 이 드라이버를 사용하면 `mysqli`나 PDO를 통해 MySQL 데이터베이스와 상호작용할 때 내부적으로 `mysqlnd`가 사용됩니다.
- 이 드라이버는 트래픽 분석, 쿼리 캐싱, 및 통계 수집 등의 고급 기능을 제공합니다.

결론적으로, `php-mysqli`는 MySQL 데이터베이스와의 상호작용을 위한 확장이며, `php-mysqlnd`는 PHP와 MySQL 데이터베이스 간의 통신을 위한 기본 드라이버입니다. 두 확장 모두 MySQL 데이터베이스를 사용하는 PHP 애플리케이션 개발에 필수적입니다.

이런 자료를 참고했어요.
[1] Naver Blog - [php]php mysqlnd mysqli : 네이버 블로그 (https://blog.naver.com/vivacarla/221182674958?viewType=pc)
[2] 웹학교 - MySQL 라이브러리 선택 - PHP 설명서 - 웹학교 (https://php.365ok.co.kr/mysqlinfo.library.choosing.php)
[3] Inpa Dev 👨‍💻 - PHP ↔ MySQL 연결 및 다루기 (mysqli 방식) - Inpa Dev ‍ (https://inpa.tistory.com/entry/PHP-%F0%9F%93%9A-DB-%EB%8B%A4%EB%A3%A8%EA%B8%B0-mysqli-%EB%B0%A9%EC%8B%9D)
[4] jirak.net - PHP 함수의 mysql 데이터베이스 확장 함수의 고찰 (https://jirak.net/wp/php-mysqlnd-mysql-native-driver/)

뤼튼 사용하러 가기 > https://agent.wrtn.ai/5xb91l
2 changes: 1 addition & 1 deletion docker/inception/srcs/requirements/wordpress/conf/php.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
;https://scripts.mit.edu/faq/64/how-do-i-enable-additional-php-extensions
[PHP]

;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -939,7 +940,6 @@ default_socket_timeout = 60
;extension=exif ; Must be after mbstring as it depends on it
; https://www.linkedin.com/advice/3/how-do-you-compare-mysqli-other-php-database-extensions
extension=mysqli
extension=mysqlnd
;extension=oci8_12c ; Use with Oracle Database 12c Instant Client
;extension=oci8_19 ; Use with Oracle Database 19 Instant Client
;extension=odbc
Expand Down
1 change: 1 addition & 0 deletions docker/inception/srcs/requirements/wordpress/conf/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ group = nobody
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
;https://battlecook.github.io/2017/12/22/nginx-phpfpm-communication.html
listen = 9000

; Set listen(2) backlog.
Expand Down

0 comments on commit 80177c2

Please sign in to comment.