-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (56 loc) · 1.88 KB
/
Dockerfile
File metadata and controls
75 lines (56 loc) · 1.88 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
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
74
75
FROM php:8.4-cli-bookworm AS base
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
curl \
git \
unzip \
libpq-dev \
libzip-dev \
libonig-dev \
libicu-dev \
&& docker-php-ext-install \
pdo \
pdo_pgsql \
pgsql \
zip \
mbstring \
intl \
opcache \
pcntl \
sockets \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
FROM base AS rr-downloader
RUN curl -sSL https://github.com/roadrunner-server/roadrunner/releases/download/v2024.3.5/roadrunner-2024.3.5-linux-amd64.tar.gz \
| tar -xz -C /tmp \
&& mv /tmp/roadrunner-2024.3.5-linux-amd64/rr /usr/local/bin/rr \
&& chmod +x /usr/local/bin/rr
FROM base AS builder
WORKDIR /var/www/html
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-scripts --no-autoloader --prefer-dist
COPY package.json yarn.lock* ./
RUN yarn install --frozen-lockfile 2>/dev/null || yarn install
COPY . .
RUN composer dump-autoload --optimize --no-dev
RUN yarn build
RUN mkdir -p storage/logs storage/framework/cache storage/framework/sessions storage/framework/views bootstrap/cache \
&& chmod -R 775 storage bootstrap/cache
FROM base AS app
WORKDIR /var/www/html
COPY --from=rr-downloader /usr/local/bin/rr /usr/local/bin/rr
COPY --from=builder /var/www/html .
COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
COPY docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8000
ENTRYPOINT ["/entrypoint.sh"]