Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: docker
Browse files Browse the repository at this point in the history
curious-mike-dvc committed Jul 20, 2024

Verified

This commit was signed with the committer’s verified signature.
zeeshanlakhani Zeeshan Lakhani
1 parent c625754 commit fe8c577
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -6,7 +6,9 @@ RUN apk update && apk add --no-cache \
nginx \
supervisor \
bash \
nano
nano \
dcron \
libcap

# Create necessary directories and set permissions
RUN mkdir -p /var/run/nginx \
@@ -28,7 +30,10 @@ RUN mkdir -p /var/run/nginx \
&& touch /var/log/php-fpm/php-fpm.log \
&& chown www-data:www-data /var/log/php-fpm/php-fpm.log \
&& mkdir -p /run \
&& chown www-data:www-data /run
&& chown www-data:www-data /run \
&& chown -R www-data:www-data /etc/crontabs \
&& chown www-data:www-data /usr/sbin/crond \
&& setcap cap_setgid=ep /usr/sbin/crond

# Copy Nginx and Supervisor configuration files
COPY ./config/nginx.conf /etc/nginx/nginx.conf
@@ -47,8 +52,11 @@ COPY ./config/php.ini /usr/local/etc/php/php.ini
# Set permissions
RUN chown -R www-data:www-data /var/lib/nginx /var/log/nginx /run/nginx /var/log/supervisor /var/run

# TEMP
COPY ./index.php /var/www/html/index.php
# Add non root user to the tty group, so we can write to stdout and stderr
RUN addgroup www-data tty

# Setup Working Dir
WORKDIR /var/www

# Switch to www-data user to run services
USER www-data

0 comments on commit fe8c577

Please sign in to comment.