-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (50 loc) · 1.88 KB
/
Copy pathDockerfile
File metadata and controls
72 lines (50 loc) · 1.88 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
62
63
64
65
66
67
68
69
70
71
72
# Build frontend assets on a fixed Node 14 image (Laravel Mix 2 / node-sass).
FROM node:14-bullseye-slim AS frontend
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
g++ \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json ./
RUN npm ci
COPY resources/assets resources/assets
COPY webpack.mix.js .
RUN mkdir -p public
RUN npm run production \
&& node -e "const fs=require('fs'); fs.writeFileSync('public/mix-manifest.json', JSON.stringify({'/js/app.js':'/js/app.js','/css/app.css':'/css/app.css'}));"
FROM php:8.2
LABEL maintainer="Attila Szeremi <attila+webdev@szeremi.com>"
WORKDIR /var/www
RUN apt-get update && apt-get install -y --no-install-recommends \
$PHPIZE_DEPS \
curl \
git \
unzip \
zlib1g-dev \
libzip-dev \
libbrotli-dev \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
COPY bin/docker-php-pecl-install /usr/local/bin/
RUN docker-php-ext-install zip pcntl
RUN docker-php-pecl-install swoole
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY composer.json composer.lock ./
RUN mkdir -p database/seeders database/factories
RUN composer install --no-scripts --no-interaction --prefer-dist
COPY package.json package-lock.json ./
COPY resources/assets resources/assets
COPY webpack.mix.js ./
COPY --from=frontend /app/public/js public/js
COPY --from=frontend /app/public/css public/css
COPY --from=frontend /app/public/mix-manifest.json public/mix-manifest.json
COPY . .
RUN mkdir -p bootstrap/cache && chmod a+rwx bootstrap/cache
RUN composer install --optimize-autoloader --no-interaction
RUN mkdir -p storage/framework/{cache,sessions,views} \
&& chmod -R a+rwx storage/framework/{cache,sessions,views}
RUN chmod a+rw database/
CMD ["bin/start.sh"]