-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
39 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM php:8.2-fpm
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim unzip git curl libonig-dev libxml2-dev libzip-dev \
&& docker-php-ext-install pdo_mysql mbstring zip exif pcntl
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www
COPY . .
# Create database directory if using SQLite (you can skip this if only using MySQL)
RUN mkdir -p /var/www/database && touch /var/www/database/database.sqlite
# Install dependencies
RUN composer install --optimize-autoloader --no-dev
# Laravel permissions
RUN chown -R www-data:www-data /var/www \
&& chmod -R 755 /var/www/storage
EXPOSE 8000
# Run artisan commands at runtime instead
CMD php artisan config:clear && \
php artisan config:cache && \
php artisan migrate --force && \
php -S 0.0.0.0:8000 -t public