-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (65 loc) · 1.91 KB
/
Dockerfile
File metadata and controls
76 lines (65 loc) · 1.91 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# =========================
# Base Image (FrankenPHP)
# =========================
FROM dunglas/frankenphp:php8.2
# =========================
# System Dependencies
# =========================
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
zip \
unzip \
git \
curl \
libzip-dev \
libicu-dev \
ca-certificates \
gnupg \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql intl zip pcntl
# =========================
# Install Node.js + pnpm
# =========================
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g pnpm
# =========================
# Set Working Directory
# =========================
WORKDIR /app
# =========================
# Install Composer
# =========================
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# =========================
# Copy Application
# =========================
COPY . .
# =========================
# Install PHP dependencies
# =========================
RUN composer install --no-interaction --prefer-dist --optimize-autoloader
# =========================
# Install frontend dependencies & build
# =========================
RUN pnpm install --frozen-lockfile && pnpm build
# =========================
# Permissions (Laravel)
# =========================
RUN chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R 775 storage bootstrap/cache
# =========================
# Install Laravel Octane
# =========================
RUN composer require laravel/octane \
&& php artisan octane:install --server=frankenphp
# =========================
# Expose FrankenPHP Port
# =========================
EXPOSE 8000
# =========================
# Start Octane Server
# =========================
CMD ["php", "artisan", "octane:start", "--server=frankenphp", "--host=0.0.0.0", "--port=8000"]