Skip to content

Commit b73819d

Browse files
committed
Adjust dockerfile
1 parent 05eacec commit b73819d

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ tests
1616
.phpunit.result.cache
1717
.styleci.yml
1818
phpunit.xml
19-
docs
2019
ssl
2120
db
2221
redis

docker/app/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
FROM node:25-alpine AS docs
2+
3+
WORKDIR /docs
4+
COPY ./docs/ ./
5+
RUN npm install && npm run build
6+
17
FROM php:8.4-fpm-alpine
28

39
LABEL maintainer="Samuel Weirich"
@@ -89,7 +95,7 @@ RUN mkdir -p /var/log/php
8995
COPY ./docker/app/ldap/ /etc/openldap
9096

9197
# Copy application files
92-
COPY --chown=www-data:www-data ./ /var/www/html
98+
COPY --exclude=docs --chown=www-data:www-data ./ /var/www/html
9399

94100
# Add folder to git safe.directory
95101
RUN su-exec www-data git config --global --add safe.directory /var/www/html
@@ -108,8 +114,8 @@ RUN if [ "$VITE_COVERAGE" != "true" ] ; then \
108114
RUN su-exec www-data composer install --no-dev
109115
RUN su-exec www-data composer dump-autoload -o
110116

111-
# Copy docs (Only for this branch, REMOVE before merge!)
112-
RUN su-exec www-data cd docs && npm install && npm run build && cp -r build/* /var/www/html/public/PILOS/
117+
# Copy docs (Only for this branch, REMOVE before merge!) from the first stage
118+
COPY --chown=www-data:www-data --from=docs /docs/build/ /var/www/html/public/PILOS/
113119

114120
EXPOSE 80
115121
EXPOSE 443

0 commit comments

Comments
 (0)