-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
86 lines (71 loc) · 1.88 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# PHP Dependencies
# https://laravel-news.com/multi-stage-docker-builds-for-laravel
#
FROM composer:latest as vendor
COPY database/ database/
COPY composer.json composer.json
COPY composer.lock composer.lock
# COPY auth.json auth.json
RUN composer install \
--no-dev \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
#
# Frontend
#
FROM node:latest as frontend
RUN mkdir -p /app/public
COPY package.json webpack.mix.js package-lock.json /app/
COPY resources/js/ /app/resources/js/
COPY resources/sass/ /app/resources/sass/
WORKDIR /app
RUN npm install && npm run production
#
# Application
#
FROM drupal:8-fpm
# https://hub.docker.com/_/drupal
# install the PHP extensions pcntl & cron
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
vim \
libwebp-dev \
libjpeg62-turbo-dev \
libxpm-dev \
libmcrypt-dev \
libfreetype6-dev \
libmcrypt-dev \
; \
\
docker-php-ext-configure gd \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-freetype-dir=/usr/include/freetype2 \
; \
docker-php-ext-install -j "$(nproc)" \
gd \
mbstring \
pcntl \
bcmath \
; \
\
rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/www/html \
&& mkdir /var/www/html
COPY . /var/www/html
COPY --from=vendor /app/vendor/ /var/www/html/vendor/
COPY --from=frontend /app/public/js/ /var/www/html/public/js/
COPY --from=frontend /app/public/css/ /var/www/html/public/css/
COPY --from=frontend /app/mix-manifest.json /var/www/html/mix-manifest.json
COPY docker/start.sh /usr/local/bin/start
RUN mkdir -p /var/www/html/storage/app/public/loginqr \
&& mkdir -p /var/www/html/storage/app/public/referrals
RUN chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R ug+rwx storage bootstrap/cache \
&& chmod u+x /usr/local/bin/start
CMD ["/usr/local/bin/start"]