Fix Dockerfile

This commit is contained in:
2024-11-11 21:26:02 +01:00
parent 21e78f017a
commit 8dbc692bae
2 changed files with 15 additions and 27 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
.env
vendor/
node_modules/
database/*.sqlite

View File

@ -1,32 +1,16 @@
FROM php:8.3-cli
LABEL authors="andp97"
FROM node:22-slim AS assets
# Install dependencies
RUN apt-get update && apt-get install -y \
nodejs \
npm \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip
WORKDIR /app
COPY --chown=node:node . /app
# Install PHP extensions
RUN docker-php-ext-install mbstring exif pcntl bcmath gd
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
COPY . .
# Install dependencies
RUN composer install
RUN npm install
RUN npm run build
EXPOSE 8000
CMD ["php", "artisan", "serve", "--host=0.0.0.0"]
FROM serversideup/php:8.3-fpm-apache
LABEL authors="andp97"
COPY --chown=www-data:www-data . /var/www/html
# Install dependencies
RUN composer install
COPY --from=assets --chown=www-data:www-data /app /var/www/html