-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (27 loc) · 1.35 KB
/
Dockerfile
File metadata and controls
40 lines (27 loc) · 1.35 KB
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
FROM php:8.2-zts AS build
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions @composer ev sodium zip intl uuid ev pcntl parallel apcu
COPY composer.json composer.lock /app/
WORKDIR /app
RUN composer install --no-dev -o --apcu-autoloader
FROM build AS css
ADD --chmod=777 https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.2/tailwindcss-linux-x64 /usr/local/bin/twcss
COPY . .
RUN twcss -i public/assets/style.css -o public/assets/web.css --minify
FROM registry.bottled.codes/base/frankenphp:latest AS web
RUN install-php-extensions @composer dom intl mbstring sodium zip uuid apcu
RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini && \
echo "opcache.jit_buffer_size=100M" >> $PHP_INI_DIR/php.ini
COPY . /app/
COPY --from=css /app/public/assets/web.css /app/public/assets/web.css
COPY --from=build /app/vendor /app/vendor
RUN composer dump -o --apcu
FROM build AS backend
RUN apt update && apt install -y inotify-tools && \
rm -rf /var/lib/apt/lists/*
RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini && \
echo "apc.enable_cli=1" >> $PHP_INI_DIR/php.ini && \
echo "apc.enable=1" >> $PHP_INI_DIR/php.ini
COPY --from=css /usr/local/bin/twcss /usr/local/bin/twcss
COPY . /app/
ENTRYPOINT ["php","src/Server.php"]