-
Notifications
You must be signed in to change notification settings - Fork 432
/
Dockerfile
52 lines (39 loc) · 1.68 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
##############################################
# Stage 1: Install node dependencies and run gulp
##############################################
FROM node:11 as npm
WORKDIR /app
COPY package.json /app
COPY package-lock.json /app
RUN npm install
COPY resources /app/resources
COPY gulpfile.js /app
RUN npm run gulp
##############################################
# Stage 2: Composer, nginx and fpm
##############################################
FROM bkuhl/fpm-nginx:7.3
WORKDIR /var/www/html
# Contains laravel echo server proxy configuration
COPY /nginx.conf /etc/nginx/conf.d
USER www-data
ADD --chown=www-data:www-data /composer.json /var/www/html
ADD --chown=www-data:www-data /composer.lock /var/www/html
RUN composer global require hirak/prestissimo \
&& composer install --no-interaction --no-autoloader --no-dev --prefer-dist --no-scripts \
&& rm -rf /home/www-data/.composer/cache
ADD --chown=www-data:www-data /storage /var/www/html/storage
ADD --chown=www-data:www-data /bootstrap /var/www/html/bootstrap
ADD --chown=www-data:www-data /public /var/www/html/public
ADD --chown=www-data:www-data /artisan /var/www/html
ADD --chown=www-data:www-data /database /var/www/html/database
ADD --chown=www-data:www-data /config /var/www/html/config
ADD --chown=www-data:www-data /app /var/www/html/app
RUN composer dump-autoload --optimize --no-dev \
&& touch /var/www/html/database/database.sqlite \
&& php artisan optimize \
&& php artisan migrate
ADD --chown=www-data:www-data /resources /var/www/html/resources
COPY --chown=www-data:www-data --from=npm /app/public/css /var/www/html/public/css
COPY --chown=www-data:www-data --from=npm /app/public/js /var/www/html/public/js
USER root