Skip to content

Commit

Permalink
Run worker as "www-data" user
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusklocke committed Feb 11, 2024
1 parent 24b7860 commit 1afe564
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY --from=roadrunner /usr/bin/rr /usr/local/bin/rr
RUN set -xe \
&& apk update \
&& apk upgrade \
&& apk add --no-cache fcgi gmp gnupg ncurses \
&& apk add --no-cache gmp gnupg ncurses \
&& apk add --no-cache --virtual .build-deps ${PHPIZE_DEPS} gmp-dev linux-headers \
&& docker-php-ext-install bcmath gmp pcntl pdo_mysql opcache sockets > /tmp/ext-install.log 2>&1 || (cat /tmp/ext-install.log; exit 1) \
&& pecl channel-update pecl.php.net \
Expand All @@ -35,6 +35,9 @@ COPY docker/php/php.ini /usr/local/etc/php/php.ini
COPY docker/php/entrypoint.sh /usr/local/bin/docker-php-entrypoint
RUN chmod +x /usr/local/bin/docker-php-entrypoint

# Configure RoadRunner
COPY docker/php/roadrunner/.rr.yaml /usr/local/etc/rr.yaml

# Prepare logos directory
ENV APP_LOGOS_PATH="/var/www/logos"
RUN mkdir ${APP_LOGOS_PATH}
Expand Down Expand Up @@ -68,4 +71,4 @@ RUN chown www-data:www-data ${APP_LOGOS_PATH} && chmod +x bin/*
ENV PATH="${PATH}:${APP_HOME}/bin:${APP_HOME}/vendor/bin"
EXPOSE 8080
HEALTHCHECK --interval=15s --timeout=1s CMD curl 127.0.0.1:8080/api/health || exit 1
CMD lima migrations:migrate -n && rr serve -c config/roadrunner.yml
CMD lima migrations:migrate -n && rr serve -c /usr/local/etc/rr.yaml
4 changes: 3 additions & 1 deletion config/roadrunner.yml → docker/php/roadrunner/.rr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: '3'
server:
command: "php ../bin/rr-server.php"
command: "php /var/www/api/bin/rr-server.php"
user: "www-data"
group: "www-data"
http:
address: "0.0.0.0:8080"
pool:
Expand Down

0 comments on commit 1afe564

Please sign in to comment.