-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
39 lines (29 loc) · 1 KB
/
dockerfile
File metadata and controls
39 lines (29 loc) · 1 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
# ---------- PHP + Apache ----------
FROM php:8.2-apache
WORKDIR /var/www/html
RUN apt-get update && apt-get install -y \
git unzip zip curl nodejs npm \
libzip-dev libonig-dev libxml2-dev \
libpng-dev libjpeg-dev libfreetype6-dev \
libpq-dev \
&& docker-php-ext-configure gd --with-jpeg --with-freetype \
&& docker-php-ext-install pdo_pgsql mbstring bcmath xml gd zip \
&& rm -rf /var/lib/apt/lists/*
# Enable Apache rewrite
RUN a2enmod rewrite
# Copy app
COPY . .
# Set public as document root
RUN sed -i 's|/var/www/html|/var/www/html/public|g' /etc/apache2/sites-available/000-default.conf
# Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN composer install --no-dev --optimize-autoloader
# Build Tailwind
RUN npm install
RUN npm run build
# Permissions
RUN chown -R www-data:www-data storage bootstrap/cache
EXPOSE 80
CMD php artisan migrate --force && \
while true; do php artisan schedule:run --no-interaction; sleep 60; done & \
apache2-foreground