Skip to content
This repository was archived by the owner on Oct 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker/data/*
10 changes: 3 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ services:
dockerfile: ./docker/php/php.dockerfile
target: development
args:
USER_ID: ${UID:-1000}
GROUP_ID: ${GID:-1000}
volumes:
- .:/var/www/html
USER_ID: ${UID:-1004}
GROUP_ID: ${GID:-1004}
networks:
- sapience
extra_hosts:
Expand All @@ -38,7 +36,6 @@ services:
image: mariadb:lts
restart: unless-stopped
tty: true
user: root
ports:
- ${DB_EXTERNAL_PORT:-3307}:3306
volumes:
Expand Down Expand Up @@ -132,7 +129,7 @@ services:
image: typesense/typesense:29.0
restart: unless-stopped
ports:
- ${TYPESENSE_PORT:-8108}:8108
- 8110:8108
volumes:
- ./docker/data/typesense:/data
command: '--data-dir /data --api-key=${TYPESENSE_API_KEY:-xyz} --enable-cors'
Expand All @@ -151,4 +148,3 @@ services:
TYPESENSE_API_KEY: ${TYPESENSE_API_KEY:-xyz}
depends_on:
- typesense

29 changes: 26 additions & 3 deletions docker/php/php.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ FROM base AS development
# Switch to root so we can do root things
USER root

# Install Poppler utilities
# Install Poppler utilities and Node.js
RUN apt-get update && \
apt-get install -y --no-install-recommends poppler-utils && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -32,6 +34,17 @@ RUN docker-php-serversideup-set-id www-data $USER_ID:$GROUP_ID && \
# Update the file permissions for our NGINX service to match the new UID/GID
docker-php-serversideup-set-file-permissions --owner $USER_ID:$GROUP_ID --service nginx

WORKDIR /var/www/html

# Copy our app files as www-data (33:33)
COPY --chown=www-data:www-data . /var/www/html

RUN composer install

RUN npm install

RUN chown -R www-data:www-data /var/www/html

# Drop back to our unprivileged user
USER www-data

Expand All @@ -47,11 +60,21 @@ USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends poppler-utils && \
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Drop back to our unprivileged user
USER www-data
WORKDIR /var/www/html

# Copy our app files as www-data (33:33)
COPY --chown=www-data:www-data . /var/www/html

RUN composer install

RUN npm install

RUN chown -R www-data:www-data /var/www/html

# Drop back to our unprivileged user
USER www-data