diff --git a/benchmarks/data-serving-relational/server/Dockerfile b/benchmarks/data-serving-relational/server/Dockerfile index 5273de01f..2f346a361 100644 --- a/benchmarks/data-serving-relational/server/Dockerfile +++ b/benchmarks/data-serving-relational/server/Dockerfile @@ -1,7 +1,11 @@ FROM cloudsuite/postgresql:15 # Install sudo for user switching -RUN apt update && apt install sudo python3 -y +RUN set -eux ; \ + apt update ; \ + apt install python3 gosu -y ; \ + rm -rf /var/lib/apt/lists/* ; \ + gosu postgres true # Make the database access public RUN echo 'host\tall\tcloudsuite\t0.0.0.0/0\tscram-sha-256' >> /etc/postgresql/15/main/pg_hba.conf diff --git a/benchmarks/data-serving-relational/server/docker-entrypoint.py b/benchmarks/data-serving-relational/server/docker-entrypoint.py index 73422e830..24dba764c 100644 --- a/benchmarks/data-serving-relational/server/docker-entrypoint.py +++ b/benchmarks/data-serving-relational/server/docker-entrypoint.py @@ -81,8 +81,8 @@ def save_dict(config_dict, lines): f.writelines(file_txt) os.system("service postgresql start") -os.system("sudo -u postgres psql -c \"CREATE USER cloudsuite WITH PASSWORD 'cloudsuite';\"") # Create the user called `cloudsuite` -os.system("sudo -u postgres psql -c \"CREATE DATABASE sbtest;\"") # Create a table named sbtest -os.system("sudo -u postgres psql -c \"GRANT ALL PRIVILEGES ON DATABASE sbtest TO cloudsuite\"") # Gave permission to this table -os.system("sudo -u postgres psql sbtest -c \"GRANT ALL ON SCHEMA public TO cloudsuite;\"") -os.system("sudo -u postgres psql") +os.system("gosu postgres psql -c \"CREATE USER cloudsuite WITH PASSWORD 'cloudsuite';\"") # Create the user called `cloudsuite` +os.system("gosu postgres psql -c \"CREATE DATABASE sbtest;\"") # Create a table named sbtest +os.system("gosu postgres psql -c \"GRANT ALL PRIVILEGES ON DATABASE sbtest TO cloudsuite\"") # Gave permission to this table +os.system("gosu postgres psql sbtest -c \"GRANT ALL ON SCHEMA public TO cloudsuite;\"") +os.system("gosu postgres psql") diff --git a/benchmarks/web-serving/web_server/Dockerfile b/benchmarks/web-serving/web_server/Dockerfile index 881d1d61b..3cf6ab862 100644 --- a/benchmarks/web-serving/web_server/Dockerfile +++ b/benchmarks/web-serving/web_server/Dockerfile @@ -41,8 +41,9 @@ RUN mkdir /elgg_data RUN chmod a+rw /elgg_data # Copy over the Nginx Server configuration -COPY files/nginx_sites_avail_pt.append /tmp/ -COPY files/nginx_sites_avail_tls.append /tmp/ +RUN rm /etc/nginx/sites-enabled/default +COPY files/nginx_sites_avail_pt /etc/nginx/sites-available/ +COPY files/nginx_sites_avail_tls /etc/nginx/sites-available/ RUN service nginx restart diff --git a/benchmarks/web-serving/web_server/bootstrap.sh b/benchmarks/web-serving/web_server/bootstrap.sh index 22bb4ae66..77f817acb 100755 --- a/benchmarks/web-serving/web_server/bootstrap.sh +++ b/benchmarks/web-serving/web_server/bootstrap.sh @@ -17,9 +17,9 @@ sed -i -e"s/mysql_server/${DB_SERVER_IP}/" elgg/elgg-config/settings.php sed -i -e"s/'memcache_server'/'${MEMCACHE_SERVER_IP}'/" elgg/elgg-config/settings.php if [ $PROTOCOL == 'https' ]; then - cat /tmp/nginx_sites_avail_tls.append >> /etc/nginx/sites-available/default + ln -sf ../sites-available/nginx_sites_avail_tls /etc/nginx/sites-enabled/cloudsuite elif [ $PROTOCOL == 'http' ]; then - cat /tmp/nginx_sites_avail_pt.append >> /etc/nginx/sites-available/default + ln -sf ../sites-available/nginx_sites_avail_pt /etc/nginx/sites-enabled/cloudsuite fi FPM_CHILDREN=${5:-4} diff --git a/benchmarks/web-serving/web_server/files/nginx_sites_avail_pt.append b/benchmarks/web-serving/web_server/files/nginx_sites_avail_pt similarity index 100% rename from benchmarks/web-serving/web_server/files/nginx_sites_avail_pt.append rename to benchmarks/web-serving/web_server/files/nginx_sites_avail_pt diff --git a/benchmarks/web-serving/web_server/files/nginx_sites_avail_tls.append b/benchmarks/web-serving/web_server/files/nginx_sites_avail_tls similarity index 100% rename from benchmarks/web-serving/web_server/files/nginx_sites_avail_tls.append rename to benchmarks/web-serving/web_server/files/nginx_sites_avail_tls