-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
66 lines (50 loc) · 1.25 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
#
# Prep App's PHP Dependencies
#
FROM composer:2.1 as vendor
WORKDIR /app
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist \
--quiet
FROM php:8.1-fpm-alpine as phpserver
# add cli tools
RUN apk update \
&& apk upgrade \
&& apk add nginx
RUN apk add --no-cache \
libzip-dev \
zip \
&& docker-php-ext-install zip
# silently install 'docker-php-ext-install' extensions
RUN set -x
RUN docker-php-ext-install pdo_mysql bcmath > /dev/null
# Install INTL
RUN apk add icu-dev
RUN docker-php-ext-configure intl && docker-php-ext-install intl
COPY nginx.conf /etc/nginx/nginx.conf
COPY php.ini /usr/local/etc/php/conf.d/local.ini
RUN cat /usr/local/etc/php/conf.d/local.ini
WORKDIR /var/www
COPY . /var/www/
COPY --from=vendor /app/vendor /var/www/vendor
#
# Prep App's Frontend CSS & JS now
# so some symfony UX dependencies can access to vendor
#
RUN apk add nodejs
RUN apk add npm
RUN npm install npm@latest -g
RUN npm install yarn@latest -g
RUN node -v
RUN npm -v
RUN yarn install
RUN yarn run build
EXPOSE 80
COPY docker-entry.sh /etc/entrypoint.sh
ENTRYPOINT ["sh", "/etc/entrypoint.sh"]