-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (30 loc) · 1.29 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
FROM debian:buster
ENV AUTOINDEX on
WORKDIR /var/www/localhost
ENV SSL_PATH=/etc/nginx/ssl \
WP_URL=https://wordpress.org/latest.tar.gz \
WP_TAR=latest.tar.gz \
PHPMA_URL=https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz \
PHPMA_TAR=phpMyAdmin-latest-all-languages.tar.gz
RUN set -eu; \
apt-get update && apt-get install -y \
default-mysql-server \
nginx \
php7.3-fpm php7.3-mysql php7.3-xml php7.3-mbstring \
wget; \
rm -rf /var/lib/apt/lists/*; \
chown -R www-data:www-data ./; \
mkdir ./phpmyadmin ./phpmyadmin/tmp /etc/nginx/ssl /var/log/nginx/localhost; \
chmod 777 ./phpmyadmin/tmp; \
wget $PHPMA_URL -P /tmp; \
wget $WP_URL -P /tmp; \
tar -xzvf /tmp/$WP_TAR; \
tar -xzvf /tmp/$PHPMA_TAR -C ./phpmyadmin --strip-components 1; \
rm /tmp/$PHPMA_TAR /tmp/$WP_TAR; \
openssl req -newkey rsa:2048 -x509 -nodes -days 365 \
-keyout $SSL_PATH/localhost.key -out $SSL_PATH/localhost.crt \
-subj "/C=JP/ST=Tokyo/L=Tokyo/O=42 Tokyo/CN=localhost"; \
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~LOADING~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
COPY srcs/* /tmp/
EXPOSE 80 443
ENTRYPOINT ["bash", "/tmp/run.sh"]