Skip to content

Commit 08871d1

Browse files
committed
All point to mydb host
1 parent 14356b1 commit 08871d1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ COPY . /var/www/sqlmap/
2525
WORKDIR /var/www/sqlmap
2626

2727
# Now point the scripts to connect to mysql
28-
RUN sed -i 's/"localhost"/"mysql"/' /var/www/sqlmap/libs/mysql.inc.php
29-
RUN sed -i 's/"localhost"/"mysql"/' /var/www/sqlmap/libs/mysql_user.inc.php
28+
RUN sed -i 's/"localhost"/"mydb"/' /var/www/sqlmap/libs/mysql.inc.php
29+
RUN sed -i 's/"localhost"/"mydb"/' /var/www/sqlmap/libs/mysql_user.inc.php
3030

3131
# Listen on port 80
3232
EXPOSE 80

docker-compose.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
mysql:
1+
mydb:
22
image: mysql
33
environment:
44
- MYSQL_ROOT_PASSWORD=testpass
55

6-
76
testenv:
87
image: andresriancho/testenv:latest
98
ports:
109
- "8998:80"
1110
links:
12-
- mysql
11+
- mydb
12+
environment:
13+
- APACHE_RUN_USER=www-data
14+
- APACHE_RUN_GROUP=www-data
15+
- APACHE_LOG_DIR=/var/log/apache2/
1316

docker/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22

33
# Wait for database to get available
4-
MYSQL_LOOPS="10"
5-
MYSQL_HOST="mysql"
4+
MYSQL_LOOPS="20"
5+
MYSQL_HOST="mydb"
66
MYSQL_PORT="3306"
77

88
# Wait for mysql
@@ -19,7 +19,7 @@ done
1919

2020

2121
echo "Create the database"
22-
mysql -u root -ptestpass -h mysql mysql < /var/www/sqlmap/schema/mysql.sql
22+
mysql -u root -ptestpass -h ${MYSQL_HOST} mysql < /var/www/sqlmap/schema/mysql.sql
2323

2424

2525
echo "Start apache"

0 commit comments

Comments
 (0)