-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (18 loc) · 685 Bytes
/
Copy pathDockerfile
File metadata and controls
22 lines (18 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM justintime50/nginx-php:8.5-36
ARG PROD
ENV PROD=$PROD
COPY --chown=www-data:www-data ./src /var/www/html
COPY docker/supervisor/ /etc/supervisor/conf.d/
RUN if [ -n "$PROD" ]; then \
# Setup prod env
composer install -q --no-ansi --no-interaction --no-scripts --no-plugins --no-progress --prefer-dist --optimize-autoloader --no-dev \
&& npm install -s --omit=dev \
&& npx vite build; \
# Setup dev env
else \
composer install \
&& npm install; \
fi \
# Setup shared env
&& php artisan storage:link
ENTRYPOINT ["/bin/sh", "-c", "if [ -n \"$PROD\" ]; then php artisan optimize; else php artisan optimize:clear; fi; exec supervisord"]