8000 Add Permission Configurations to Dockerfile · sunilgitb/laravel-docker@c46c565 · GitHub
[go: up one dir, main page]

Skip to content

Commit c46c565

Browse files
Add Permission Configurations to Dockerfile
1 parent bcf31cf commit c46c565

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.docker/php/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ COPY php.ini /usr/local/etc/php/
44
COPY docker.conf /usr/local/etc/php-fpm.d/docker.conf
55
COPY .bashrc /root/
66

7+
# Copy the entrypoint script
8+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
9+
RUN chmod +x /usr/local/bin/entrypoint.sh
10+
711
# mix
812
RUN apt-get update \
913
&& apt-get install -y build-essential zlib1g-dev default-mysql-client curl gnupg procps vim git unzip libzip-dev libpq-dev \
@@ -53,3 +57,7 @@ RUN git clone https://github.com/seebi/dircolors-solarized
5357

5458
EXPOSE 5173
5559
WORKDIR /var/www
60+
61+
#entrypoint
62+
ENTRYPOINT ["entrypoint.sh"]
63+
CMD ["php-fpm"]

.docker/php/entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Set permissions for Laravel directories
5+
chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
6+
chmod -R 775 /var/www/storage /var/www/bootstrap/cache
7+
8+
# permissions for PHPMyAdmin
9+
mkdir -p /sessions
10+
11+
chmod 777 /sessions
12+
13+
exec "$@"

0 commit comments

Comments
 (0)
0