-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
73 lines (59 loc) · 1.7 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
#
# Prep App's PHP Dependencies
#
FROM composer/composer:2-bin as composer
FROM composer:2.5.1 as vendor
WORKDIR /app
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install --no-scripts
#
# Prep App's Frontend CSS & JS now
# so some symfony UX dependencies can access to vendor
#
FROM node:18-alpine as node
WORKDIR /app
COPY --from=vendor /app/vendor vendor/
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY . .
RUN yarn install
RUN yarn build
#RUN ls public
FROM php:8.2-fpm-alpine as phpserver
# add cli tools
RUN apk update \
&& apk upgrade \
&& apk add nginx
RUN apk add --no-cache \
libzip-dev \
zip \
freetype \
libpng \
libjpeg-turbo \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev \
&& docker-php-ext-configure gd \
--with-freetype --with-jpeg \
&& NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& docker-php-ext-install -j${NPROC} gd \
&& apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev \
&& 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 && docker-php-ext-enable 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
COPY --from=composer /composer /usr/bin/composer
COPY --from=node /app/public/build /var/www/public/build
EXPOSE 80
COPY docker-entry.sh /etc/entrypoint.sh
ENTRYPOINT ["sh", "/etc/entrypoint.sh"]