-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 897 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 897 Bytes
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
FROM laravelsail/php84-composer:latest
# Install required dependencies
RUN apt-get update && apt-get install -y \
unzip git curl libzip-dev libpng-dev libpq-dev libonig-dev libxml2-dev \
&& docker-php-ext-install zip pdo pdo_pgsql \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /var/www/html
# Copy project files
COPY . .
# Install production dependencies and optimize autoloader
RUN composer install --no-dev --optimize-autoloader
# Clear config and cache routes
RUN php artisan config:clear && \
php artisan config:cache && \
php artisan route:cache
# Expose port (for reference, Render will use the PORT variable)
EXPOSE 8080
# Custom startup command for Render
CMD php artisan migrate --force && \
php artisan db:seed --force && \
php artisan serve --host=0.0.0.0 --port=${PORT:-8080}