Skip to content

Commit

Permalink
Bugfix and Docker adjustment (#61)
Browse files Browse the repository at this point in the history
[Changes]
- Close bugfix #59 - function now returns 0 in case of error
- Dockerfile
  - Include 2 new config files + browser update command
  - Fix .dockerignore

[Add]
- New .gitattributes files > make sure things are right during commit
  • Loading branch information
RustyBraze authored Sep 24, 2024
1 parent 85145e5 commit 2b0d7a8
Show file tree
Hide file tree
Showing 7 changed files with 535 additions and 6 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
docker/
!docker/entrypoint.sh
!docker/nginx.conf
!docker/config/

# Configuration
config/config.php
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.sh text eol=lf
*.conf text eol=lf
*.md text eol=lf
11 changes: 9 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ WORKDIR /app
COPY .babelrc .browserslistrc package.json webpack.config.js yarn.lock /app/
RUN yarn --frozen-lockfile
COPY resources/assets/ /app/resources/assets
RUN npx update-browserslist-db@latest
RUN yarn build

# Generate application structure
Expand All @@ -39,13 +40,19 @@ COPY --from=themes /app/public/assets /app/public/assets/
RUN find /app/storage/ -type f -not -name VERSION -exec rm {} \;

# Build the PHP/Nginx container
FROM php:8.2-fpm-alpine as production
FROM php:8.2-fpm-alpine AS production
WORKDIR /var/www
RUN apk add --no-cache icu-dev nginx && \
docker-php-ext-install intl pdo_mysql && \
sed -i 's/9000/127.0.0.1:9000/' /usr/local/etc/php-fpm.d/zz-docker.conf

# Copy files to the right places
COPY docker/entrypoint.sh /
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/config/nginx.conf /etc/nginx/nginx.conf
COPY docker/config/opcache.ini /usr/local/etc/php/php.d/opcache.ini
COPY docker/config/www.conf /usr/local/etc/php-fpm.d/www.conf


ENTRYPOINT /entrypoint.sh

Check warning on line 56 in docker/Dockerfile

View workflow job for this annotation

GitHub Actions / build-docker / main

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
EXPOSE 80
COPY --from=data /app/ /var/www
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions docker/config/opcache.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[opcache]
opcache.enable = 1
; 0 means it will check on every request
; 0 is irrelevant if opcache.validate_timestamps=0 which is desirable in production
opcache.revalidate_freq = 0
opcache.validate_timestamps = 1
opcache.max_accelerated_files = 10000
opcache.memory_consumption = 192
opcache.max_wasted_percentage = 10
opcache.interned_strings_buffer = 16
opcache.fast_shutdown = 1
Loading

0 comments on commit 2b0d7a8

Please sign in to comment.