Skip to content

Commit 8205ec0

Browse files
author
Philipp Kübler
committed
add entrypoint
1 parent d65cc34 commit 8205ec0

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ RUN yarn config set strict-ssl false && \
107107
COPY ./home/app/ /home/app/
108108
COPY ./root/.bashrc /root/
109109
RUN find /home/app -name "run-*.sh" -exec chmod -v +x {} \;
110+
RUN chmod +x /home/app/entrypoint.sh
110111

111112
# run the application
113+
ENTRYPOINT bash /home/app/entrypoint.sh
112114
CMD /home/app/run-prod.sh
113115
EXPOSE 8080

home/app/entrypoint.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
echo "Running entrypoint script..."
3+
4+
set -e
5+
6+
# make sure Laravel can write its own files
7+
mkdir -p /opt/app/storage/logs/
8+
touch /opt/app/storage/logs/laravel.log
9+
touch /opt/app/storage/logs/worker.log
10+
11+
chown www-data:www-data -R /opt/app/storage
12+
chown www-data:www-data -R /opt/app/bootstrap/cache
13+
14+
# create storage symlink
15+
echo "create storage symlink..."
16+
su www-data -s /bin/sh -c "php artisan storage:link -q"
17+
18+
# startup commands
19+
php /usr/local/bin/startup_commands.php | bash
20+
21+
cd /opt/app
22+
23+
"$@"

0 commit comments

Comments
 (0)