diff --git a/Dockerfile b/Dockerfile index 5081050..0f01273 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,9 @@ COPY refresh.php /var/www/html/ COPY libnotices.py /usr/local/bin/ COPY requirements.txt / RUN pip3 install -r /requirements.txt +RUN mkdir /var/www/.aws RUN chmod +x /usr/local/bin/libnotices.py +RUN chown www-data:www-data /var/www -R RUN apt clean EXPOSE 80 -CMD ( cron -l 8 & ) && apache2ctl -D FOREGROUND \ No newline at end of file +CMD ( cron -l 8 & ) && su -u www-data python3 /usr/local/bin/libnotices.py && apache2ctl -D FOREGROUND \ No newline at end of file diff --git a/crontab b/crontab index b629e91..5caa22e 100644 --- a/crontab +++ b/crontab @@ -1 +1 @@ -0 17 * * * python3 /usr/local/bin/libnotices.py \ No newline at end of file +0 17 * * * www-data python3 /usr/local/bin/libnotices.py \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c6633ea..425385e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,4 +7,4 @@ services: - "80:80" volumes: - "./libaccounts.json:/var/www/data/libaccounts.json" - - "./credentials:/root/.aws/credentials" \ No newline at end of file + - "./credentials:/var/www/.aws/credentials" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3a0a771..e6593da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ boto==2.49.0 boto3==1.26.27 -botocore==1.29.27 \ No newline at end of file +botocore==1.29.27 +requests==2.28.1 +tabulate==0.8.9 \ No newline at end of file