Skip to content

Commit

Permalink
Merge pull request #59 from LibreCodeCoop/feature/update-node-setup
Browse files Browse the repository at this point in the history
Update node setup and add new extension dependency
  • Loading branch information
vitormattos authored Nov 10, 2023
2 parents b883d84 + 846c383 commit 0fa5a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions .docker/Dockerfile.php80
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ RUN apt-get update \
# cron
busybox-static \
&& mkdir -p /var/spool/cron/crontabs \
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data \
# Install node
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install --no-install-recommends -y nodejs \
&& node --version \
&& npm --version
&& echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data

# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
Expand Down Expand Up @@ -49,6 +44,10 @@ RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
# pevent errors when try to create files at /var/www with user www-data
&& chown -R www-data /var/www

COPY --from=node:20.5-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=node:20.5-slim /usr/local/bin/node /usr/local/bin/node
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY config/php/* /usr/local/etc/php/conf.d/
COPY scripts/* /var/www/scripts/
Expand Down
2 changes: 1 addition & 1 deletion .docker/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ http {

# Adding the cache control header for js, css and map files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|js|woff2?|svg|gif|map)$ {
location ~ \.(?:css|js|mjs|woff2?|svg|gif|map)$ {
try_files $uri /index.php$request_uri;
add_header Cache-Control "public, max-age=15778463";
# Add headers to serve security related headers (It is intended to
Expand Down

0 comments on commit 0fa5a7e

Please sign in to comment.