forked from aaronpk/Meetable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (41 loc) · 1.28 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (41 loc) · 1.28 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
FROM php:8.2-apache
# Install the extension installer binary
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Install runtime system utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
zip \
unzip \
default-mysql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install all core and PECL PHP extensions
RUN install-php-extensions \
pdo_mysql \
mbstring \
exif \
pcntl \
bcmath \
gd \
imagick \
redis
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Configure Apache
COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf
RUN a2enmod rewrite
# Set working directory
WORKDIR /var/www/html
# Copy existing application directory
COPY . /var/www/html
# Install dependencies
RUN composer install --no-dev --optimize-autoloader --no-interaction
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
# Copy entrypoint script
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Use entrypoint to run migrations and then start apache
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["apache2-foreground"]