-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
50 lines (40 loc) · 1.42 KB
/
Containerfile
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
FROM php:8.2-fpm-alpine as local
WORKDIR /var/www/symfony
RUN apk add --no-cache bash \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& curl -sS https://get.symfony.com/cli/installer | bash \
&& mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
EXPOSE 8000
### CI STAGE
FROM local as ci
### SYMFONY REQUIREMENT
RUN apk add --no-cache icu-dev \
&& docker-php-ext-install intl \
&& docker-php-ext-enable intl \
&& docker-php-ext-install opcache \
&& docker-php-ext-enable opcache
COPY ./.container/symfony.ini /usr/local/etc/php/conf.d/
### =================
### IMAGE HEALTHCHECK
HEALTHCHECK --interval=5s --timeout=3s --retries=3 CMD symfony check:req
### =================
### INSTALL DEPENDENCIES
COPY composer.json composer.lock symfony.lock ./
RUN set -eux; \
composer install --prefer-dist --no-progress --no-scripts --no-interaction --optimize-autoloader;
### =================
### COPY PROJECT FILES AND DIRECTORY
COPY bin bin/
COPY config config/
COPY migrations migrations/
COPY public public/
COPY src src/
COPY tests tests/
COPY .env .env.test .php-cs-fixer.dist.php phpstan.neon phpunit.xml.dist ./
### =================
### INSTALL DEPENDENCIES WITH SCRIPTS
RUN set -eux; \
composer install --prefer-dist --no-interaction --no-scripts --no-progress; \
composer run-script post-install-cmd \
composer clear-cache
### =================