-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·51 lines (39 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
executable file
·51 lines (39 loc) · 1.14 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
FROM php:8.3-fpm
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
libjpeg-dev \
libfreetype6-dev \
&& docker-php-ext-configure gd --with-jpeg --with-freetype \
&& docker-php-ext-install zip pdo pdo_mysql mbstring exif pcntl bcmath gd
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/symfony
# Copy composer files
COPY composer.json composer.lock ./
# Set up the environment
ENV APP_ENV=dev
ENV APP_DEBUG=1
# Copy existing application directory
COPY . .
# Create storage directory and set permissions
RUN mkdir -p storage/framework/{sessions,views,cache} && \
mkdir -p storage/logs && \
chmod -R 777 storage && \
chmod -R 777 bootstrap/cache
# Install dependencies
RUN composer install --no-scripts --no-autoloader
# Generate autoloader
RUN composer dump-autoload --optimize
EXPOSE 8000
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]