Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
FROM debian:9.2

LABEL maintainer "opsxcq@strm.sh"
FROM debian:11

RUN apt-get update && \
apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
debconf-utils && \
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 \
&& \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
apache2 \
iputils-ping \
mariadb-server \
php \
php-mysql \
php-pgsql \
php-pear \
php-gd \
ca-certificates \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY php.ini /etc/php5/apache2/php.ini
COPY php.ini /etc/php/7.4/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 && \
RUN service mariadb 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;"
mariadb -uroot -pvulnerables -e "CREATE USER app@localhost IDENTIFIED BY 'vulnerables';CREATE DATABASE dvwa;GRANT ALL privileges ON dvwa.* TO 'app'@localhost;GRANT FILE ON *.* TO 'app'@'localhost';"

EXPOSE 80

LABEL org.opencontainers.image.authors="guillomovitch@gmail.com" \
version="1.2"

COPY main.sh /

ENTRYPOINT ["/main.sh"]
4 changes: 2 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

chown -R mysql:mysql /var/lib/mysql /var/run/mysqld

echo '[+] Starting mysql...'
service mysql start
echo '[+] Starting mariadb...'
service mariadb start

echo '[+] Starting apache'
service apache2 start
Expand Down
Loading