Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit e1d5207

Browse files
committed
[CI] build
1 parent d55a890 commit e1d5207

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
uses: docker/build-push-action@v6
4242
with:
4343
context: .
44+
file: ./docker/frankenphp/Dockerfile
4445
push: ${{ github.event_name != 'pull_request' }}
4546
tags: ${{ steps.meta.outputs.tags }}
4647
labels: ${{ steps.meta.outputs.labels }}

docker/frankenphp/Dockerfile

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
# Stage phpbuilder
1+
# Stage phpbuilder
22
# Install php extensions and composer dependencies
3-
FROM dunglas/frankenphp:php8.4 AS phpbuilder
3+
FROM dunglas/frankenphp:php8.4-alpine AS phpbuilder
44
LABEL authors="rohsyl"
55
ARG USER=www-data
66
ENV SERVER_NAME="http://"
7-
RUN install-php-extensions \
8-
pcntl pdo_mysql curl yaml \
9-
gd mbstring \
10-
intl xml bcmath \
11-
zip intl readline redis sockets && \
12-
pecl install excimer && \
13-
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
7+
8+
RUN apk add --no-cache \
9+
shadow \
10+
libcap \
11+
&& install-php-extensions \
12+
pcntl pdo_mysql curl yaml \
13+
gd mbstring \
14+
intl xml bcmath \
15+
zip intl readline redis sockets && \
16+
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
17+
1418
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
15-
RUN useradd -D -d /app ${USER} && \
16-
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \
19+
20+
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp && \
1721
chown -R ${USER}:${USER} /data/caddy /config/caddy /app && \
1822
chmod 775 /app
23+
1924
WORKDIR /app
2025
USER ${USER}
26+
2127
COPY --chown=${USER}:${USER} composer.json composer.lock ./
2228
RUN composer install --no-autoloader
29+
2330
COPY --chown=${USER}:${USER} . .
31+
2432
RUN mkdir -p storage/framework/sessions && \
2533
mkdir -p storage/framework/cache && \
2634
mkdir -p storage/framework/views && \
@@ -29,12 +37,14 @@ RUN mkdir -p storage/framework/sessions && \
2937
chmod -R 775 storage/logs && \
3038
chmod -R 775 storage/framework
3139

32-
# Stage : app
40+
# Stage: app
3341
# Build the app with needed composer dependencies, add assets dependencies
34-
# and run laravel octane to serve the ap
42+
# and run Laravel Octane to serve the app
3543
FROM phpbuilder AS app
44+
3645
RUN composer dump-autoload -o && \
3746
php artisan optimize
47+
3848
EXPOSE 8000
3949
ENTRYPOINT ["php", "/app/artisan", "octane:frankenphp"]
4050
HEALTHCHECK --start-period=5s --interval=10s --timeout=5s --retries=8 CMD php /app/artisan octane:status || exit 1

0 commit comments

Comments
 (0)