Skip to content

Commit b42d566

Browse files
Merge pull request #311 from IFRCGo/develop
fix
2 parents 48d84c6 + ba9cf3c commit b42d566

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

docker/Dockerfile

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,43 @@ RUN apt-get update && \
1616
libssl-dev \
1717
zlib1g-dev \
1818
libjpeg-dev \
19-
libfreetype6-dev \
20-
nodejs \
21-
npm && \
22-
apt-get clean && \
23-
rm -rf /var/lib/apt/lists/*
19+
libfreetype6-dev && \
20+
apt-get clean
2421

25-
RUN docker-php-ext-install pdo pdo_mysql zip gd && \
22+
23+
RUN docker-php-ext-install \
24+
pdo \
25+
pdo_mysql \
26+
zip \
27+
gd && \
2628
a2enmod rewrite
2729

30+
COPY ./docker/vhost.conf /etc/apache2/sites-available/000-default.conf
31+
COPY ./ /var/www/html
2832

29-
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
3033

3134
WORKDIR /var/www/html
3235

33-
COPY composer.json composer.lock ./
34-
RUN composer install --prefer-dist --no-scripts --no-autoloader
35-
36-
COPY package.json package-lock.json ./
37-
38-
RUN npm install
39-
40-
COPY . .
4136

37+
COPY --from=composer /usr/bin/composer /usr/bin/composer
4238

43-
RUN composer dump-autoload --optimize
39+
RUN chmod -R 775 /var/www/html/storage /var/www/html/bootstrap/cache /var/www/html/public \
40+
&& chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache /var/www/html/public
4441

42+
RUN composer install --prefer-dist --optimize-autoloader
4543

46-
RUN npm run production
47-
48-
COPY ./docker/vhost.conf /etc/apache2/sites-available/000-default.conf
44+
RUN php artisan l5-swagger:generate
4945

5046

5147
RUN mkdir -p storage/framework/sessions \
5248
storage/framework/views \
5349
storage/framework/cache \
54-
&& chown -R www-data:www-data storage bootstrap/cache \
55-
&& chmod -R 775 storage bootstrap/cache
50+
&& chmod -R 775 storage bootstrap/cache \
51+
&& chown -R www-data:www-data storage bootstrap/cache
5652

57-
RUN php artisan l5-swagger:generate
53+
54+
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
55+
apt-get install -y nodejs && \
56+
node -v && npm -v
57+
58+
RUN npm install && npm run production

0 commit comments

Comments
 (0)