forked from Statbus/Statbus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
54 lines (38 loc) · 1.11 KB
/
Copy pathdockerfile
File metadata and controls
54 lines (38 loc) · 1.11 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
# --- Stage 1 --- #
FROM node:18-bullseye AS build
FROM dunglas/frankenphp:latest AS php-base
ENV APP_ENV=prod
RUN apt-get update && apt-get install -y \
curl \
gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& corepack enable \
&& corepack prepare yarn@stable --activate \
&& rm -rf /var/lib/apt/lists/*
RUN install-php-extensions \
@composer
# Copy application
COPY . .
RUN cp /app/php.ini /usr/local/etc/php/conf.d/statbus.ini
# Install PHP dependencies
RUN composer install --prefer-dist --no-dev --no-progress --optimize-autoloader --ignore-platform-reqs
# Install and build frontend assets
RUN yarn install && yarn run build
# --- Stage 2 --- #
FROM dunglas/frankenphp:latest
ARG USER=www-data
WORKDIR /app
RUN install-php-extensions \
pdo_mysql \
gd \
intl \
zip \
opcache \
imagick
COPY --from=php-base /app /app
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \
chown -R ${USER}:${USER} /config/caddy /data/caddy
RUN chown -R ${USER}:${USER} var vendor
ENV APP_ENV=prod
EXPOSE 443