5 # Install the needed software
6 RUN apk add --no-cache curl nginx php8-fpm php8-sqlite3 php8-opcache sqlite nodejs git npm bash build-base supervisor
8 # Create the www-data user and group
10 addgroup -g 82 -S www-data ; \
11 adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1
14 RUN ln -s /usr/bin/php8 /usr/bin/php
16 # Copy supervisor conf file
17 COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
22 COPY docker/docker-entrypoint.sh .
25 ADD https://git.pomf.se/Pomf/uguu/archive/v${VERSION}.tar.gz v${VERSION}.tar.gz
26 RUN tar xvf v${VERSION}.tar.gz
28 # Create the needed directories
29 RUN mkdir /var/www/uguu/dist && \
30 mkdir /var/www/db && \
33 # Create the Sqlite DB
34 RUN sqlite3 /var/www/db/uguu.sq3 -init /var/www/uguu/sqlite_schema.sql && \
35 chown -R www-data:www-data /var/www && \
36 chmod -R 775 /var/www/
39 RUN chmod a+x /var/www/uguu/checkdb.sh && \
40 chmod a+x /var/www/uguu/checkfiles.sh && \
41 sed -i 's#/path/to/files/#/var/www/uguu/files/#g' /var/www/uguu/checkfiles.sh && \
42 sed -i 's#/path/to/db/uguu.sq3#/var/www/db/uguu.sq3#g' /var/www/uguu/checkdb.sh
45 RUN echo "0,30 * * * * bash /var/www/uguu/checkfiles.sh" >> /var/spool/cron/crontabs/www-data && \
46 echo "0,30 * * * * bash /var/www/uguu/checkdb.sh" >> /var/spool/cron/crontabs/www-data
48 # Copy Nginx Server conf
49 COPY docker/uguu.conf /etc/nginx/http.d/
52 COPY docker/ssl /etc/ssl
55 COPY dist.json /var/www/uguu/dist.json
57 # Give permissions to www-data
58 RUN chown -R www-data:www-data /run /var/lib/php8 /var/lib/nginx /var/log/nginx /var/log/php8 /etc/nginx /etc/php8
60 # Change user to www-data
63 # Expose port 80 from the container
66 # Expose port 443 from the container
70 ENTRYPOINT [ "bash", "/var/www/docker-entrypoint.sh" ]