forked from atul73cx/ast-advanced-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (30 loc) · 1.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
FROM debian:9.2
LABEL maintainer "[email protected]"
RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
debconf-utils && \
echo mariadb-server mysql-server/root_password password vulnerables | debconf-set-selections && \
echo mariadb-server mysql-server/root_password_again password vulnerables | debconf-set-selections && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
apache2 \
mariadb-server \
php \
php-mysql \
php-pgsql \
php-pear \
php-gd \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY php.ini /etc/php5/apache2/php.ini
COPY dvwa /var/www/html
COPY config.inc.php /var/www/html/config/
RUN chown www-data:www-data -R /var/www/html && \
rm /var/www/html/index.html
RUN service mysql start && \
sleep 3 && \
mysql -uroot -pvulnerables -e "CREATE USER app@localhost IDENTIFIED BY 'vulnerables';CREATE DATABASE dvwa;GRANT ALL privileges ON dvwa.* TO 'app'@localhost;"
EXPOSE 80
COPY main.sh /
ENTRYPOINT ["/main.sh"]