6 RUN apk add --no-cache $PHPIZE_DEPS \
7 php-fpm zlib-dev libzip-dev libgomp; \
8 docker-php-ext-install intl pcntl gd exif zip pdo mysql dom; \
9 apk del $PHPIZE_DEPS; \
12 # Install the needed software
13 RUN apk add --no-cache sqlite nodejs git npm bash build-base supervisor curl wget nginx
14 #php8-fileinfo php8-pdo php8-tokenizer php8-dom php8-iconv php8-xml php8-simplexml \
15 #php8-sqlite3 php8-opcache php8-mbstring php8-phar php8-openssl
17 # Create the www-data user and group
19 # addgroup -g 82 -S www-data ; \
20 # adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1
22 # Copy supervisor conf file
23 COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
28 COPY docker/docker-entrypoint.sh .
30 # Decompress into Docker
31 COPY docker/uguuForDocker.tar.gz /var/www/
32 RUN mkdir /var/www/uguu
33 RUN tar -xvf uguuForDocker.tar.gz -C uguu
35 # Create the needed directories
36 RUN mkdir /var/www/files && \
39 # Create the Sqlite DB
40 RUN sqlite3 /var/www/db/uguu.sq3 -init /var/www/uguu/src/static/dbSchemas/sqlite_schema.sql && \
41 chown -R www-data:www-data /var/www && \
42 chmod -R 775 /var/www/
45 RUN chmod a+x /var/www/uguu/src/static/scripts/checkdb.sh && \
46 chmod a+x /var/www/uguu/src/static/scripts/checkfiles.sh && \
47 sed -i 's#/path/to/files/#/var/www/uguu/files/#g' /var/www/uguu/src/static/scripts/checkfiles.sh && \
48 sed -i 's#/path/to/db/uguu.sq3#/var/www/db/uguu.sq3#g' /var/www/uguu/src/static/scripts/checkdb.sh
51 RUN echo "0,30 * * * * bash /var/www/uguu/src/static/scripts/checkfiles.sh" >> /var/spool/cron/crontabs/www-data && \
52 echo "0,30 * * * * bash /var/www/uguu/src/static/scripts/checkdb.sh" >> /var/spool/cron/crontabs/www-data
54 # Copy Nginx Server conf
55 COPY docker/nginx/uguu.conf /etc/nginx/http.d/
58 COPY docker/ssl /etc/ssl
61 COPY docker/php/php.ini /etc/php8/
62 COPY docker/php/www.conf /etc/php8/php-fpm.d/
63 RUN mkdir /var/run/php
66 COPY src/config.json /var/www/uguu/config.json
68 # Give permissions to www-data
69 RUN chown -R www-data:www-data /run /var/lib/nginx /var/log/nginx /etc/nginx /etc/php8 /var/log/php8 /var/run/php
71 # Change user to www-data
74 # Expose port 80 from the container
77 # Expose port 443 from the container
81 ENTRYPOINT [ "bash", "/var/www/docker-entrypoint.sh" ]