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
|
FROM node:22-slim AS assets
|
||||||
LABEL authors="andp97"
|
|
||||||
|
|
||||||
# Install dependencies
|
WORKDIR /app
|
||||||
RUN apt-get update && apt-get install -y \
|
COPY --chown=node:node . /app
|
||||||
nodejs \
|
|
||||||
npm \
|
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
libpng-dev \
|
|
||||||
libonig-dev \
|
|
||||||
libxml2-dev \
|
|
||||||
zip \
|
|
||||||
unzip
|
|
||||||
|
|
||||||
# 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 install
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 8000
|
FROM serversideup/php:8.3-fpm-apache
|
||||||
CMD ["php", "artisan", "serve", "--host=0.0.0.0"]
|
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