-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (53 loc) · 1.31 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
ARG php_version=8.4
ARG frankenphp_version=1.4
FROM dunglas/frankenphp:${frankenphp_version}-php${php_version} AS base
WORKDIR /laravel
SHELL ["/bin/bash", "-eou", "pipefail", "-c"]
ENV SERVER_NAME=:80
ARG user=laravel
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
COPY --chmod=755 src/entrypoint.sh /entrypoint.sh
COPY --chmod=755 src/common /common
COPY --chown=${user}:${user} src/artisan artisan
COPY src/php.ini "${PHP_INI_DIR}/php.ini"
RUN apt-get update \
&& apt-get satisfy -y --no-install-recommends \
"curl (>=7.88)" \
"unzip (>=6.0)" \
"vim-tiny (>=2)" \
&& rm -rf /var/lib/apt/lists/*
RUN useradd \
--uid 1000 \
--shell /bin/bash \
"${user}" \
&& setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp \
&& chown -R "${user}:${user}" \
/laravel \
/data/caddy \
/config/caddy \
/var/{log,run} \
&& chmod -R a+rw \
/var/{log,run}
RUN install-php-extensions \
bcmath \
bz2 \
curl \
exif \
gd \
intl \
pcntl \
pdo_pgsql \
opcache \
redis \
sockets \
zip
USER ${user}
RUN mkdir -p \
bootstrap/cache \
storage/framework/cache \
storage/framework/sessions \
storage/framework/testing \
storage/framework/views \
storage/logs \
&& chmod -R a+rw storage
ENTRYPOINT ["/entrypoint.sh"]