Skip to content

Commit 08b2a34

Browse files
committed
docker entrypoint to apply correct user on volume
1 parent 265b52e commit 08b2a34

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

infra/docker/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ COPY infra/docker/.htaccess public/
3636
# Update project
3737
RUN /usr/bin/composer install --no-dev \
3838
&& ./scripts/post-create-project \
39-
&& chown 33:33 -R .
39+
&& chown www-data:www-data -R .
4040

41-
CMD ["apache2-foreground"]
41+
COPY infra/docker/entrypoint.sh /
42+
43+
ENTRYPOINT ["/entrypoint.sh", "apache2-foreground"]

infra/docker/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
chown -R www-data:www-data /var/app/data
5+
6+
if [ -d /mnt/applications ]
7+
then
8+
chown -R www-data:www-data /mnt/applications
9+
fi
10+
11+
exec "$@"

0 commit comments

Comments
 (0)