-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (48 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
61 lines (48 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
53
54
55
56
57
58
59
60
61
# Base image
FROM php:8.2-fpm
RUN apt-get update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs
# Arguments
ARG user=laravel
ARG uid=1000
# Set working directory
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
sqlite3 \
libsqlite3-dev \
gnupg \
ca-certificates \
supervisor \
nginx \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions
RUN docker-php-ext-install pdo pdo_sqlite mbstring exif pcntl bcmath gd zip
# Install composer
COPY --from=composer:2.6 /usr/bin/composer /usr/bin/composer
# Copy existing application directory contents
COPY . /var/www/html
# Build the front-end assets
RUN npm install
RUN npm run build
RUN npm cache clean --force
# Set permissions
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache || true
# Copy php.ini
COPY docker/php/php.ini /usr/local/etc/php/php.ini
# Expose port 9000 for php-fpm
EXPOSE 9000
# Entrypoint
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
CMD ["/usr/local/bin/entrypoint.sh"]