-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
64 lines (50 loc) · 2.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM debian:buster
MAINTAINER gipark <[email protected]>
#update package && install utils
RUN apt-get update && apt-get install -y vim unzip curl expect openssl
#install nginx && setting nginx config
RUN apt-get install -y nginx
COPY ./srcs/default /etc/nginx/sites-available/default
#install php7.3-fpm
RUN apt-get install -y php7.3-fpm
COPY ./srcs/index.htm /var/www/html/
#install mysql
RUN apt-get install -y mariadb-server php-mysql
#install php-mbstring && setting php extenstion config
#Mbstring stands for multi-byte string functions. Mbstring is an extension of php used to manage non-ASCII strings.
RUN apt-get install -y php-mbstring
COPY ./srcs/php.ini /etc/php/7.3/fpm/php.ini
#setting ssl protocol
RUN openssl req -newkey rsa:2048 -x509 -sha256 -days 365 -nodes -out /etc/ssl/certs/private.crt -keyout /etc/ssl/private/private.key -subj "/C=KR/ST=Seoul/L=Gang-nam/OU=42seoul/OU=gipark/CN=student.42seoul.kr"
#set workdir for phpmyadmin and wordpress
WORKDIR /var/www/html
#install phpMyAdmin && setting phpMyAdmin config
RUN curl https://files.phpmyadmin.net/phpMyAdmin/4.9.5/phpMyAdmin-4.9.5-all-languages.zip -o phpMyAdmin.zip &&\
unzip phpMyAdmin.zip &&\
rm -rf phpMyAdmin.zip &&\
mv phpMyAdmin-4.9.5-all-languages/ phpmyadmin
COPY ./srcs/config.inc.php ./phpmyadmin
#install wordpress && setting wordpress config
COPY ./srcs/wordpress-5.5.1.zip ./
RUN unzip wordpress-5.5.1.zip &&\
rm -rf wordpress-5.5.1.zip
COPY ./srcs/wp-config.php ./wordpress
#set permission
RUN chown -R www-data:www-data * &&\
chmod -R 755 *
#set workdir for mysql_config
WORKDIR /etc/mysql
#setting mysql config
COPY ./srcs/mysql_secure_installation_auto.sh ./
RUN chmod +x ./mysql_secure_installation_auto.sh
COPY ./srcs/debian.cnf ./debian.cnf
COPY ./srcs/mysql_config.sql ./
COPY ./srcs/init_mysql.sh ./
RUN chmod +x ./init_mysql.sh
#set starting services
COPY ./srcs/init_service.sh /
RUN chmod +x /init_service.sh
CMD service mysql start &&\
bash ./mysql_secure_installation_auto.sh &&\
bash ./init_mysql.sh &&\
bash /init_service.sh