-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
41 lines (26 loc) · 903 Bytes
/
Dockerfile.prod
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
FROM php:7.3.6-fpm-alpine3.9 as builder
MAINTAINER Pablo Sousa <pablosousa.ads@gmail.com>
# install extensions and aplications linux
RUN apk add --no-cache openssl bash mysql-client nodejs npm
RUN docker-php-ext-install pdo pdo_mysql
# install composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www
RUN rm -rf /var/www/html
RUN ln -s public html
COPY ./.docker/php/php.ini /usr/local/etc/php/conf.d/
COPY . /var/www
RUN composer install \
&& php artisan cache:clear \
&& chmod -R 777 storage
RUN npm install
FROM php:7.3.6-fpm-alpine3.9
RUN apk add --no-cache openssl mysql-client
RUN docker-php-ext-install pdo pdo_mysql
WORKDIR /var/www
RUN rm -rf /var/www/html
COPY --from=builder /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/
COPY --from=builder /var/www .
EXPOSE 9000
ENTRYPOINT ["php-fpm"]