-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (48 loc) · 1.88 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
FROM debian:buster
LABEL version="1.0.0" \
maintainer="Caio Vinicius"
#install necessary things
RUN ["apt-get", "update", "-y"]
RUN ["apt-get", "upgrade", "-y"]
#install nginx
RUN ["apt-get", "install", "nginx", "-y"]
#install mariadb-server
RUN ["apt-get", "install", "mariadb-server", "-y"]
#install php modules
RUN ["apt-get", "install", "php-fpm", "php-mysql", "php-mbstring", "php-zip", "php-gd", "-y"]
#remove packages already installed
RUN ["apt-get", "clean"]
ARG NGINXPATH=/srcs/nginx
ARG MARIADBPATH=/srcs/mariadb
ARG PMAPATH=/srcs/phpmyadmin
ARG WPPATH=/srcs/wordpress
#copying key and certificate to configure ssl on nginx
COPY ["$NGINXPATH/ssl/nginx-selfsigned.crt", "/etc/ssl/certs/"]
COPY ["$NGINXPATH/ssl/nginx-selfsigned.key", "/etc/ssl/private/"]
#setup nginx
ENV AUTOINDEX off
RUN ["rm", "-f", "/etc/nginx/sites-enabled/default"]
RUN ["rm", "-f", "/etc/nginx/sites-available/default"]
RUN ["rm", "-rf", "/var/www/html"]
COPY ["$NGINXPATH/sites-available/index.html", "/var/www/"]
COPY ["$NGINXPATH/sites-available/autoindex.sh", "/etc/nginx/sites-available/"]
COPY ["$NGINXPATH/sites-available/ft_server", "/etc/nginx/sites-available/"]
RUN ["ln", "-s", "/etc/nginx/sites-available/ft_server", "/etc/nginx/sites-enabled/"]
#setup phpMyAdmin
ADD ["$PMAPATH/pma495.tar.gz", "/"]
RUN ["mv", "phpMyAdmin-4.9.5-english/", "/var/www/phpmyadmin"]
RUN ["mkdir", "-p", "/var/lib/phpmyadmin/tmp"]
RUN ["chmod", "777", "/var/lib/phpmyadmin/tmp"]
COPY ["$PMAPATH/config.inc.php", "/var/www/phpmyadmin/"]
#setup mariadb
COPY ["$MARIADBPATH/dbconfig.sh", "/"]
#setup wordpress
ADD ["$WPPATH/wplatest.tar.gz", "/"]
RUN ["mv", "wordpress/", "/var/www/"]
COPY ["$WPPATH/wp-config.php", "/var/www/wordpress/"]
#this container will be exposed on 80 and 443 port
EXPOSE 80/tcp 443/tcp
#copy script to execute things
COPY ["srcs/init.sh", "/"]
#execute sh to start nginx, mariadb and php
ENTRYPOINT ["sh", "init.sh"]