Skip to content

Commit

Permalink
feat: #30 try frankenphp to serve the php app and static files
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Jul 4, 2024
1 parent 78b7784 commit f2ecb99
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM bitnami/php-fpm:latest
FROM dunglas/frankenphp:latest

RUN echo "extension=pdo_pgsql.so" >> /opt/bitnami/php/etc/php.ini

RUN install_packages nodejs npm \
&& apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives
RUN apt-get update \
&& apt-get install -y nodejs npm \
&& apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives \
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& curl https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet

WORKDIR /app

ENV COMPOSER_ALLOW_SUPERUSER=1
ENV SERVER_NAME="0.0.0.0:8080"

COPY package.json .
COPY package-lock.json .
Expand All @@ -17,16 +19,13 @@ RUN npm i --frozen-lockfile
COPY composer.json .
COPY composer.lock .

RUN composer install --no-scripts
RUN php composer.phar install --no-scripts

COPY . .

RUN composer install
RUN php composer.phar install

RUN npm run build \
&& apt-get -y remove npm \
&& apt-get -y clean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists /var/cache/apt/archives \
&& rm -rf node_modules/ \
&& chown -R daemon:daemon .
&& apt-get -y autoremove

0 comments on commit f2ecb99

Please sign in to comment.