Fix Dockerfile
This commit is contained in:
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
.env
|
||||
vendor/
|
||||
node_modules/
|
||||
database/*.sqlite
|
||||
38
Dockerfile
38
Dockerfile
@ -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
|
||||
|
||||
Reference in New Issue
Block a user